Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

metamorphic

C or C++?

This topic is 6142 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a student at college studying computer studies. Next year im going to be doing a games programming course for 3 years. The point is that the book i have, and almost all the articles on gamedev.net use C not C++. Why dont they use C++? which one should i learn? If i should learn C first, is there any problems learning C++ after? (ive heard people have a hard time changing over some things in C++) Which is easier to program in? Thanks for any help

Share this post


Link to post
Share on other sites
Advertisement
I would definitely go C++; you can do everything you can in C in C++, but C++ has more powerful features.

Share this post


Link to post
Share on other sites
I would also recommend going straight into C++. Programming OO style requires a slightly different mindset, which can be hard to break away from if you get toooo accustomed to programming declarative languages (like C, etc.)

Share this post


Link to post
Share on other sites
OK, this frequent question is pissing me off, learn both, then choose it doesnt matter, a language doesnt make a good game, a programmer does.

Share this post


Link to post
Share on other sites
C is better. But it doesn''t matter. I would recommend learning C++ though. Nobody seems to realize that C makes more sense.

Share this post


Link to post
Share on other sites
calling a method in c++ is more expensive that calling a __cdecl function. At the ''very essence'' what''s the diference between:

DrawCircle(int radius, int xpos int ypos)
and
Circle.Draw(int xpos, int ypos)

Share this post


Link to post
Share on other sites
This is for Marius (just incase he meant what I''m afraid he did ). These two are different:
  
void DrawCircle(int radius, int xpos, int ypos) {
/* ... */
}

  
class Circle {
public:
void Draw(int radius, int xpos, int ypos) {
// ...

}
};

This one is the same as the first:
  
class Circle {
public:
static void Draw(int radius, int xpos, int ypos) {
// ...

}
};

This one is the same as the second:
  
void DrawCircle(struct Circle *C, int radius, int xpos, int ypos) {
/* ... */
}

Lesson: if it doesn''t use any member variables or functions, make it static.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
quote:
Original post by narfidoo
C is better. But it doesn''t matter. I would recommend learning C++ though. Nobody seems to realize that C makes more sense.

This is flamebait. C doesn''t make more sense. It just makes a different kind of sense. It''s procedural programming instead of object-oriented programming: it revolves around the actions rather than around the actors. C++ has several advantages over C, but is harder to learn to use properly. And that''s about it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!