Click to See Complete Forum and Search --> : C/c++ ?


thorpe
07-06-2005, 03:43 PM
i have access to a massive newsgroup archiver that bassically allows me to download any software / books / music i want. anyway, lately, ive been looking for books on programming in C. now... i download these usually to find that they are actually books on programming C++.

what i would like to know is. if i learn C++, am i correct in assuming that i would be learning C? im thinking i would maybe at some time in the future develope some php extensions or whatever...

would learning C++ allow me to write C?

drew010
07-06-2005, 04:05 PM
you will learn some c syntax and things like that, but most of what c++ did was add classes since they dont exist in c, the standard library functions (many handy things not available in c), along with templates, iterators and all kinds of things. c itself is very basic and doesnt have a whole lot that comes with it. i have found its better to learn c first, that way you learn the basic skeleton, and then if you learn c++ you learn all the additions, rather than learn the additions to the language first, and then when you are doing c, have to figure out the hard way what you no longer have anymore.
its also important with c to learn every detail about pointers, character arrays and the memory allocation and string manipulation functions, because c++ gives you the luxury of the string class, which you dont have in c. and going from string to char arrays can be tricky.

the book i recommend to learn c is by the creator himself, its called The C Programming Language (http://www.amazon.com/exec/obidos/redirect?path=ASIN/0131103628&link_code=as2&camp=1789&tag=prdesign-20&creative=9325). Its the 1989 version so it covers ANSI C89. You can find it in most bookstores that have decent computer sections too.

planetsim
07-06-2005, 07:06 PM
The C Programming Language is a great book I havent had the chance to completely read it yet which is a disappointing since its a small book. However if you wish to use this as the book to start from its not. It assumes you know a little about C before hand and races off pretty quickly.

Even though its the for C89 it shouldnt change too much to get it up to date with C99 theres not a great deal of difference.

Also if you want a little bit slower approach to learning C I really recommend getting another book and read it prior to reading the K&R (The C Programming language). I have two C How to Program its the older version but has some ok examples, the one I recommend is Sams Teach yourself C in 21days. I was a bit skeptical at first but after reading it, its by far the better of the two in my opinion and it also covers the C99 standard (one bad thing about the book it begins with showing some functions that you really shouldnt use in C however latter will show the proper functions to do the same task which they suggest you do).

thorpe
07-06-2005, 10:57 PM
ok... thanks for the advise. seems it may be worth my while to invest some time in C. really, its C im more interested in anyhow (not that im too aware of the differences)... just seems to be more resources around for C++.

the search continues. ta...

Drakla
07-06-2005, 11:24 PM
Is there any particular reason you're rather learn C++ over C?

I did lots of C++ for years writing code that was valid C (realtime 3d graphics engines) butn then when you get into game management where everything is an object with a behaviour, and having linked lists of objects that create other objects on their 'death' and remove themselves - well C++ becomes nice in those situations. C and C++ are 'wow' and because you've already come from a php background stepping into it won't be that much of a difference. And you've got true references and pointers - rah! I miss it.

thorpe
07-06-2005, 11:39 PM
Is there any particular reason you're rather learn C++ over C?
i am actually wanting to learn C not C++, just havent been able to find as many resources for C as i have been able to for C++. i'll probably never even use much of any of it... but im bored, addicted to learning, and toying with the idea of playing with / creating some extensions for php.

planetsim
07-07-2005, 12:50 AM
As for online resources your going to find that, however since doing a bit of C (I havent done much recently but will try doing something sometime) I have a found a few ok resources.

Forum
http://cboard.cprogramming.com/ - Pretty good centralised mainly around C++, but most know quite a bit of C there is a C# section too

Resources
http://cprogramming.com - Same as the forum this is the main site like I said more centralised around C++, however there is a bit on C (Just remember C isnt a big language)
http://www.cs.cf.ac.uk/Dave/C/CE.html - This is probably the best online resource for C, its all about C and more to the Unix Platform.
http://www.cppreference.com/ - C Standard Lib as well as C++ stuff.

Hope this helps with finding online stuff but if you really want to get into C you really need to look into getting a book (even going to the local library and borrowing one/two to start off).

thorpe
07-07-2005, 03:54 AM
thankyou very much kind sir. these look great. yeah... i will get around to buying a book, i usually check out a few things online first but my screen burns my eyes after a while and back to the books we go.

besides... i just love filling that bookshelf.

thanks man.

thorpe
07-07-2005, 03:56 AM
ps: i managed to find this (http://www.faqs.org/docs/learnc/) one, should post it in case someone else is interested.