C/C++

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
Ethan

C/C++

Post by Ethan »

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.
Kon-Tiki

Re:C/C++

Post by Kon-Tiki »

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-
Joey

Re:C/C++

Post by Joey »

i dont really know much about them, but i would say c++ for that reason, because there is visual c++ and stuff like that. i think its going to keep advancing and you should learn the better language. but im probably wrong. ask chris. he knows everything.
ark

Re:C/C++

Post by ark »

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.
Andrew_Baker

Re:C/C++

Post by Andrew_Baker »

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.
Post Reply