C/C++
C/C++
I know this is probably a newbisih question, but I'm a newbie. So it's okay. Anyway, I was wondering if you all recommend C or C++. Everytime I ask, I get about as many say C as say C++. I have a book on both, and I'm sure I could dig something up on the internet. If you don't recommend either, please give me what you'd use. Thanks.
Re:C/C++
Seems to me that they're the same, but I've also just started learning C. I guess C++ is just a little bit more difficult than C and allows you to do just a tiny bit more than C, but it seems as if they're practically the same.
They're also very usefull to know, but demand a couple of frustrating months before you actually know it.
Wish I knew them already ;D
-Kon-Tiki-
They're also very usefull to know, but demand a couple of frustrating months before you actually know it.
Wish I knew them already ;D
-Kon-Tiki-
Re:C/C++
In general, you'll find that straight C without any C++ extensions to it is a pain in the neck. It has arbitrary restrictions that don't really make any sense and it allows you to get away with things that it shouldn't let you get away with.
Personally, I prefer C++ because it has a less sloppy typecasting system and it has built-in object-orientation abilities. Typecasting aside, the ability to use classes, inheritance, and polymorphism alone is enough to make me choose C++ over C. If by "C" you just mean function-oriented programming instead of object-oriented programming, object-oriented code is considerably easier to understand and modify.
Personally, I prefer C++ because it has a less sloppy typecasting system and it has built-in object-orientation abilities. Typecasting aside, the ability to use classes, inheritance, and polymorphism alone is enough to make me choose C++ over C. If by "C" you just mean function-oriented programming instead of object-oriented programming, object-oriented code is considerably easier to understand and modify.
Re:C/C++
C++ is essentially a superset of C. That is, unless you're using a strange compiler, you can write a C program and compile it in a C++ compiler. C++ has added functionality and features. So, learning C is simpler (I would suggest Kernigan and Ritchie's book, because they created the language, and their book is thorough, but brief, and very, very helpful. The older the edition, the better. I have the 1975 edition, and it is thinner than my Programming the VIC-20 manual, but it contains everything essential to beginning to program in C). Plus, everything you learn about C can be applied to C++ once you've become proficient. C++ is more modern, however, and object-oriented, so it's obviously a good choice.