PDA

Click to See Complete Forum and Search --> : Difference between C and C++


Genxcop
Aug 3rd, 2001, 07:43 AM
What is the difference? Which is good for what? Which are the best compilers for both?

thanx in advance:cool:

filburt1
Aug 3rd, 2001, 08:15 AM
Massive difference: C++ is object-oriented (you can create classes) and C is not. IMHO, C is really confusing compared to C++, so I'd learn C++ instead of C.

Borland makes a free compiler for both at their web site, http://www.borland.com . But it is console-only (i.e., not an IDE).

Genxcop
Aug 3rd, 2001, 09:38 PM
Which is best for games that deal with 3d graphics such as simple rpg or ones with moving models from 3d studio max etc?

Which will be able to create programs, applications best?

Which is windows independant? able to be linux as well?

Wynd
Aug 3rd, 2001, 10:06 PM
They are both pretty much platform-independent (you'll have to recompile of course) as long as you don't use any Windows API calls or other OS-specific stuff.

parksie
Aug 4th, 2001, 01:54 AM
I use C++ normally, but if someone asked for C code I'd give it to them :) The program files generated by C compilers is a lot smaller than the equivalent C++ source, and despite being a bit more confusing, C is actually more logical. C++ is full of bits bolted on in all places and can mess beginners up.

I use C++ for most programs so that I can use the STL templates(what a lifesaver!) and also, I wrote a Window class so I don't have to mess with the API too much.

Radames
Aug 4th, 2001, 08:00 PM
For cross-platform compatabiliy use Java.

Wynd
Aug 4th, 2001, 08:49 PM
Parksie, 2 things...

1. What's the STL? How does it help?
2. What's in the window class? Can I see :)

parksie
Aug 5th, 2001, 12:44 AM
Radames - but that defeats the object of using C++ ;)

Wynd - the STL has now been incorporated into the Standard C++ Library but it's a fairly distinct part so by convention everyone calls it the Standard Template Library still (that's what it used to be before the committee put it in the standard). www.sgi.com/tech/stl is the place to go :)

As for my window class, you could have a look but it does all the message handling as well so it's complicated with lots of messing around with static member functions :) (Plus the DLL its in has Unicode support so there's some trickery to make all that compile)