Archived

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

Shrap

C or C++?

Recommended Posts

Hey guys I was just wondering if I should learn C or dive right into C++? Like I mean to learn C++ will I need to have a strong background in C? Thanks

Share this post


Link to post
Share on other sites
Nope, C++ is that way to go of the two.

C is not a level of C++, in your sense.



Gamedev for learning.
libGDN for putting it all together.
An opensource, cross platform, cross API game development library.

Share this post


Link to post
Share on other sites
no.
it''s a bad myth that you need C to learn C++.
it''s just not true.
you can learn C++ straight on.

BUT! there are things you have to learn about C++
one you''ll have to learn a little about the STL library (ex: , , , etc...).
also there are a some programming paradigms involved with C++
such as: procedural programming (which C does) Object-Oriented and Object-based programming (which is similar to Java) and generic programming (which is the ability to use templates).

so my suggestion learn C++ and start with the basics for example: using and and using procedural programming (this is just a suggestion).

anyway good luck.

Share this post


Link to post
Share on other sites
if you are going to start learning a language It is suggested that you learn C++ first. this is because c programmars have to break certain habits that c++ will not allow

But you''ll learn

Okidata

Share this post


Link to post
Share on other sites
quote:
Original post by okidata
if you are going to start learning a language It is suggested that you learn C++ first. this is because c programmars have to break certain habits that c++ will not allow



Why? Do you think there is something inherently wrong with C?

Share this post


Link to post
Share on other sites
Learn C++ first and once you have a firm grasp on the language you should take a look at C. Not because you will be hindered in capability, but because a lot of programmers use a combination of the two so some of the examples can be a bit confusing if you don''t know a little.

GRELLIN

~CGP~

Share this post


Link to post
Share on other sites
i learned c++ without learning c first. learning c first might be a little easier but u do have to unlearn some things. it really depends on how well you can learn stuff. if u are a fast learning skip c and go straight to c++. but if you arent then learn c and then learn c++.



[edited by - brass_fish on March 1, 2003 9:20:51 PM]

Share this post


Link to post
Share on other sites
C++ has all of the features of the C and a lot of new ones that support OOP. Then it's just the different in libraries that separates C & C++. Since C++ has all of the features of C you can go ahead learn C++ and then just make sure that you are familiar with standard C libraries. So that when you encounter
printf("some crap: %0.2i\n",i);
in someone's code you won't be dumbfounded.

[edited by - MOVSW on March 1, 2003 12:41:25 AM]

Share this post


Link to post
Share on other sites
C++ is the same language than C but with polymorphism and inheritance. I learned C++ before C and had no problem. I think it''s a good idea to begin learning C++ first cause i found it more easy to learn and if you know C++ in most part you know all C.

-------------------------
Knowledge Is For Everyone

SnowKing3k
SnowKing3k@hotmail.com

Share this post


Link to post
Share on other sites
c++ is just with oop and 1 or 2 other thing added, so in learning c++, you will just be learning c any way, but c++ is the more versital lang.

Share this post


Link to post
Share on other sites
Learning C++ does not mean you have learned C. Try running some of your supposed "C code" that you wrote after learning C++ through a C compiler.

It will die with the number of errors.

Share this post


Link to post
Share on other sites
I learned C first, and it has helped me appreciate the additions that have been made to C++ more than had I started with C++. When I look at my older C programs, I noticed that I always had this desire to use structs when ever possible. I had function pointers splayed about in my structs. I was essentially trying to fake object oriented programming with C, and thanks to this need for structure I became a pretty decent C programmer. My transition to C++ was simplified by the fact that it had a construct that I was already trying to achieve with C.

I say, learn C first, because it is good to be able to program in the good old rustic fashion. I recently sent a programmer''s evaluation to Electronic Arts, and they were asking primarily for knowledge about C, not C++. So it''s good to be adaptable in this case.

So, get yourself a copy of MinGW, it has both C and C++ support, and pick your path.
Good Luck!

Share this post


Link to post
Share on other sites



C++ is just a superset of C, with the OOP stuff and other things like overloading.Learning C++ from the beggining is the best way to go for games programming.The people saying that C must be learned before C++ probably have never programmed in C/C++.As MOVSW said knowing some functions from the standard C libraries can help you.

Share this post


Link to post
Share on other sites
quote:
Shrap
Hey guys I was just wondering if I should learn C or dive right into C++?
I start from C, and I tried to dive right into C++ before. From what I experience, I recommend that you start from C. Why? Just to get you familiar with how loops, if-statements, switch-case, functions, variables, structs, preprocessor directives, are done in C/C++. Those are basic stuff in programming. You can't write a game without knowing how to create a variable, etc.

In my opinion, you have to understand those before trying to learn OOP. If you learn OOP first before even knowing how to make your own functions, I think...there's a really big gap right there. In C++, you learn OOP first (i.e. cout, operator<<) before you touch if-statements. And the bad thing about C++ is, it does not encapsulate OOP as good as the other OOP languages (VB, C#, Java). Even though you can use STL right away, you _still_ need to understand some basic OOP concepts. What if you want to learn C++ but don't want to learn OOP? You need to learn to accept things the way they are without asking "why?", and there are a lot of stuff to memorize...

quote:

Like I mean to learn C++ will I need to have a strong background in C?
No. Just grab the basic stuff I mentioned above and move on to C++.

quote:
Original post by brass_fish
i learned c++ without learning c first. learning c first might be a little easier but u do have to unlearn some things.
hm..what exactly are the things that we have to unlearn? i start from C, and i never unlearned anything in C. in fact, i use almost all of them.

the idea of "learning" and "unlearning", or "which one before or after" is just because you think that one language is superior than the other, like in this case C++ is better than C (that's why you think "do i need C?"). this is not true at all. a language is a language, it's a tool that we, programmers, use. it's totally up to you.


500

[edited by - alnite on March 3, 2003 3:52:55 AM]

Share this post


Link to post
Share on other sites
It depends on what your aim is...if you want to be a professional C++ programmer then you need to know both C and C++ - start with C. Otherwise you can just dive into C++ and forget about C.

Share this post


Link to post
Share on other sites
Thank you very much guys for the overwhelming repsonse. Probably saved me a few weeks of effort that could be put into C++!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Mathematix
It helps! Knowing C before C++ helps!!!!


Knowing Java also helps, but I think the point was that you don''t have to know C to learn C++ and that because somethings are differant between C and C++ you might have to break certain habits you gained in C.

Share this post


Link to post
Share on other sites