Archived

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

starting with c instead of c++

This topic is 5670 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

Hmmm, so, heres my problem. I want to eventually be writing games in c++ once I am done learning everything, but my dad had (he left) like 20 different c language books that would basically teach me anything I would ever want to know about it. I also have the etext for the ibm pc programmers guide to c (i think from this site). So my problem is that I want to eventually write in c++, but right now I have so many c resources, it seems like a waste to not use them (since i am new to the c language in general) C++ is supposed to just expand off of c and it changes some of the syntax, correct? so would it be ok if I just went ahead and learned a lot of c, and later on started c++? or would that not be a good plan? thanks in advance

Share this post


Link to post
Share on other sites
in my opinion you should not start learning c before c++. Although a LOT of the syntax is the same, it will teach you "bad" habits in the long run (if your gonna be doin c++). Many people have a hard time transitioning from procedural programming to object oriented coding. C encourages procedural coding, so it does kind of hurt you when you move to c++.

Share this post


Link to post
Share on other sites


If you learn C++ from scratch, then you will also be learning C. Everything you learn in C can be used in C++, but somethings in C++ cant be used in C.

Plus, most C++ books will either first teach you an abbreviated C or will expect you know C.

Share this post


Link to post
Share on other sites
If you learn C before C++ just make sure to pick some up-to-date documentation on C++ and not rely on "C with classes" documentation. Several ''key'' features of the C++ library have evolved a lot since the arrival of classes.

In particular, remember that C++ standard headers do not have a .h extension.

Other than that, knowledge of the C library is always a good thing to have, even in this C++ world.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
I see no harm starting with C, as long as you keep it in the back of your mind that you will make the transition to C++ eventually. I started with C, and I don''t think I picked up any bad habits from it. On the contrary, it serves to distinguish what C++ brings to the mix. I appreciate object-oriented features all that much more, having first lived without them.

Share this post


Link to post
Share on other sites
I''m still just starting to break the habit''s I got from C. Luckily since C-code works when using C++, it''s not too hard of a hit, and you can gradually slide yourself into the Object-Oriented craze.
I would personnally say: Go straight into C++

------------
aud.vze.com - The Audacious Engine <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.

Share this post


Link to post
Share on other sites
quote:
Original post by pandabear114
ok
since i am not really getting anywhere in my current situation ()
has anyone read c++ in 21 days, and do you think it is a pretty good book for teaching all hte c++ basics if i just went straight into c++ rather than c?



unless you just really want to buy books, i''d recommend
checking out some online progressive tutorials..
cplusplus.com has some really good ones..
although their persistant use of the old style headers is a bit
odd..

if you''re definately after a book, i''d recommend C++ by Example
(cant for the life of me remember the author, but if you search
for it on amazon you''re bound to find it). As a follow up, i''d
recommend Effective C++ (ditto with the author bit here).

hope this helps



-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

Share this post


Link to post
Share on other sites
Hi !

IMO you can learn C before switching to C++.
Learning C will give you all the syntax language (loops, function declaration, preprocessors) and the knowledge about standard library.

Then there are book that guide you in the swiching from C to C++ (If I remember, the creator of C++ wrote such book)

If you work on windows, you will have to deal with the Win32 API which uses C.

----
David Sporn AKA Sporniket

Share this post


Link to post
Share on other sites