Qbasicnews.com

Full Version: C/C++ ??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
Can somebody tell me what is better/more functional/more useful:

C or C++

Im guess the latter is, but I just wanted to be sure. Also, could somebody point me in the direction to start coding in C/C++. I literally have no idea where to start. Do i need a compiler? Is there only one compiler available, like Qb45, or is there many done by different companies, etc. Any help appretiated.
1) C++ is Object Oriented. It's more powerful, and is the standard nowdays.
2) There are tons of compilers...Tons. Lots free. My suggestion: Get Dev C++ (google it) and then get a book out of your local library on C++.
Quote:Can somebody tell me what is better/more functional/more useful:

C or C++

Hey dark. C++ is (for practical purposes) a super-set of C. That means that C code *will compile* with a C++ compiler. Everything that can be written in C++ can also be written in C...although it would take a lot of code to get all the OO stuff.

C++ can be used as "a better C" structural language, and the OO stuff can be incorporated as it's needed.

There is tons of C code out there. The amount of conforming C++ is miniscule by comparison. However, learn C++ and you can't help but learn C.

At a really basic level, the main difference between C++ and C is that C++ allows structures to contain functions as well as data. In QB, it would be if you could make a TYPE that held both data and SUBs. These structures are called classes. In C, structures only contain data.

Quote:
Im guess the latter is, but I just wanted to be sure. Also, could somebody point me in the direction to start coding in C/C++. I literally have no idea where to start. Do i need a compiler? Is there only one compiler available, like Qb45, or is there many done by different companies, etc. Any help appretiated.


You need a compiler. Get one with an IDE. Dev-c++ works great for me, and it's free.

Get Bruce Eckel's book, "Thinking in C++" available free on the net.

forget graphics for the time being and learn "standard c++". You have enough to worry about...
new language/syntax
STL
compiling
preprocessor
translation units
...

Start coding simple programs that exist as a single file rather than project files, which may only serve to confuse.

if you are half as dense as I am, ask questions often to avoid the many pitfalls that are likely to get in your way...eg, I spent a month writing programms before I understood that my use of header files was so far-afield of the mainstream...it was actually stirling_Christinson (sorry sp) who helped me see how unorthodox my code was...
Ok, thanks for your in depth reply, mango, and for your short/sweet reply Zack. =P

Ooo Im so happy that C++ is free. Yey!
Word to the wise. my advise to you is to learn C first. then you will understand the structure of C++ alot better. also, stick with it, this isn't one of those languages you can pick up in an hour. it could take several months just to understand it (took me 3 weeks to understand, but i have far from mastered it).

-Mech
Quote:Word to the wise. my advise to you is to learn C first.

Chapter 3 of Vol 1 of the book I recomended is titled, "The C in C++"

and it is a basic crash course on the non-Object Oriented part of the language. Once you understand how your compiler works, this chapter will get you up and running very fast.
At:
http://mindview.net/Books

Get:
http://64.78.49.204/TICPP-2nd-ed-Vol-one.zip
first. then, after you understand the basics, get:

http://64.78.49.204/TICPP-2nd-ed-Vol-two.zip
which goes in depth about streams, strings, containers, and algs.
I agree with Mech1031, learn C first and then C++. They have the same roots (Bell labs).

But if you are a serious programmer in either of then you know that C++ is not a superset of C. They are very different.

C++ is very dificult to master, the book a recommend (and for me is a holy book) The C++ programming language.

C is not so hard to master (there's less keywords) but you must be a serious programmers. I dont recommend this language as a first programming language. The book i recommend is (of course) The C programming language.
As I've told 2394923849823948 times, C++ is crap. It's a hack. OO? Bleh, it is so bad designed that it will give you headaches. You can code intelligently in C++ and have good OO, but it is far too easy to code spaghetti OO mixed with procedural programming. OO and procedural programming should not be mixed at all. They are just different approaches. When you mix them you have CHEESY stuff. Tons of problems, tons of problems. Not worth it. For a true OO language check eiffel or Java.

And Mr Loosecaboose agrees with me Big Grin
What are most modern games developed in these days? For example, what code was Half-life done in? Are they Private development languages, coded by the games companies themselves, or in existing languages?

*not wanting to code a new game or anything, just interested*
Nearly positive that it's all C++...
Pages: 1 2 3 4 5 6 7 8 9