Hard Light Productions Forums

Off-Topic Discussion => Programming => Topic started by: Dysko on July 02, 2008, 02:43:59 pm

Title: C or C++?
Post by: Dysko on July 02, 2008, 02:43:59 pm
Today I finally completed my C course at university, and since I liked it, I'm interested in learning more about programming.

The course I took taught me the basics of C (variables, types and typedef, strings, functions, pointers, arrays, switches, structs), but I also read somewhere that C++ is better than C.

Should I continue learning C, or should I start learning C++? And where can I find good tutorials?
Title: Re: C or C++?
Post by: Ghostavo on July 02, 2008, 04:14:26 pm
C++ is basically C with objects. So if you want to dabble with OOP it might be interesting for you to learn C++. Otherwise, it's a waste of time and you'll do well to continue perfecting your knowledge of "pure" C.
Title: Re: C or C++?
Post by: Topgun on July 02, 2008, 04:25:52 pm
c++ is easier to program in than c if  you are working in a team. otherwise it depends on your way of thinking, OO or procedural.
Title: Re: C or C++?
Post by: WMCoolmon on July 03, 2008, 03:04:32 am
No, C++ generally includes STL...which I don't really like, but is a whole lot different because it introduces the concepts of vectors, iterators, and so on.

C++ is not "better" than C. There is no hierarchical ranking of programming languages. They have strengths and weaknesses.

But you probably won't want to code much with assembly.
Title: Re: C or C++?
Post by: blackhole on July 03, 2008, 08:54:12 am
STL vectors rock.
Title: Re: C or C++?
Post by: Uchuujinsan on July 03, 2008, 03:42:50 pm
C is a little faster, C++ better for complex programms (better maintainability)
Going from C to C++ is a little harder as going from C++ to C, as you can still write "c-style code" in c++, not really learning the OOP.
You cant wrtite c++ style code in c, however-
Title: Re: C or C++?
Post by: chief1983 on July 08, 2008, 11:52:46 am
And good luck programming a robot with an 8051 microcontroller with C++.
Title: Re: C or C++?
Post by: Topgun on July 08, 2008, 12:01:55 pm
that's when you would use java.


 :nervous:
Title: Re: C or C++?
Post by: blackhole on July 09, 2008, 11:14:09 pm
that's when you would use java.

RUN FOR YOUR LIIIIIIIIVES!
Title: Re: C or C++?
Post by: WMCoolmon on July 09, 2008, 11:29:08 pm
try
{
     
RUN FOR YOUR LIIIIIIIIVES!
}
catch(java.lang.Exception.RunnerException rexc)
{
     rexc.getRunner().rehabilitate();
}
Title: Re: C or C++?
Post by: blackhole on July 09, 2008, 11:32:55 pm
try
{
     
RUN FOR YOUR LIIIIIIIIVES!
}
catch(java.lang.Exception.RunnerException rexc)
{
     rexc.getRunner().rehabilitate();
}
finally
{
  fail_miserably();
}
Title: Re: C or C++?
Post by: WMCoolmon on July 10, 2008, 01:15:24 am
you.getAbility(Person.JAVA_CAPITALIZATION).setFael(true);
return lulz;

:p
Title: Re: C or C++?
Post by: blackhole on July 10, 2008, 08:17:09 pm
stab(Forum->getMember("WMCoolmon"));
Title: Re: C or C++?
Post by: Flipside on July 10, 2008, 08:26:12 pm
if getStabStatus()
{
Forum.Hammer(hardlight);
}

:P
Title: Re: C or C++?
Post by: chief1983 on July 10, 2008, 11:35:59 pm
...
catch(Hammer $h)
{
  $sql = "SELECT DISTINCT memberid FROM posts WHERE topic='54939'";

  $result = $myDatabase->query($sql);

  while($row = $myDatabase->moveNext($result))
  {
    if(getUsername($row->memberid) != "chief1983")
    {
      bootToTheHead($row->memberid);
    }
  }
  echo "im in ur thredz bootin ur hedz";
}
Title: Re: C or C++?
Post by: Flipside on July 12, 2008, 01:15:57 pm
:lol: Oh noes! Boot To The Head!

Dim pwned = New Beam(Forum.getMember(Chief1983));

...
Title: Re: C or C++?
Post by: Stormkeeper on July 13, 2008, 06:24:36 am
if(NewBeam(Forum.getMember(Chief1983)))
do
{

    int i = 1;
    i ++;
 
    if(i == 0)
    {
        i = 1;
     }
    
    Supernova(Forum.getMember(Flipside));

    if(i > 9000)
    {
         cout<<"ITS OVER NINE THOUSAND!!!!1111!!"<<endl;

     }
}while(i != 0);
Title: Re: C or C++?
Post by: CP5670 on July 13, 2008, 10:56:55 pm
I think this thread has served its purpose. :p