Jump to content

C/C++ books


jlc
 Share

Recommended Posts

www.cplusplus.com is the best I've ever seen for learning the basics of C++...most of the books I've looked at suck...I got the 'C++ All In One Desk Reference For Dummies'...'cause I was looking for a good reference book...it's totally useless. Not only does it use pretty poor code, it's full of typos and stuff...he obviously didn't check the code at all...

Now, once you've got the basics, for graphics I would recommend 'Game Programming All In One (2nd edition)'...Very nice book...all 2D graphics, but it uses Allegro and does a good job at explaining the stuff.

You also might wanna look around on www.cpp-home.com

Link to comment
Share on other sites

For an inexpensive, easy tutorial, get "C In Easy Steps" and "C++ in Easy Steps" from Barnes and Noble. These are very short, easy turtorial books that only cost $10. They'll give you a basic foundation and get you up to speed quickly and painlessly.

 

Then get the ultimate C book, and considered by many the greatest programming book of all time, "The C Programming Language" by the Dennis Ritchie (the creator of C) and Brian Kernighan. This book is terse, but full of information on C and programming in general. It is often said that if you read this book and you do the exercises, you will become a programming master, or at least become very very proficient.

 

Then for C++, get "Accelerated C++". This is an excellent beginners book, that starts with high level concepts, like the Standard Template Library, and has you use them in useful programs right off the bat.

 

Finally, for the ultimate reference and definition, as well as insight on proper C++ usage, get "The C++ Programming Language" by Bjarne Stroustrup, the creator of C++. This is not a beginners book, but is the ultimate reference for intermediate and advanced C++ programmers, as well has an invaluable teacher of how to use C++ as it applies to programming paradigms and solving real world probelms. Reading this book is like taking martial arts lessons from Bruce Lee.

 

I can say from personal experience, that "The C Programming Language", "Accelerated C++", and "The C++ Programming Language" have all propelled my understanding and proficiency with C and C++ tremendously. Where as before I had been intimidated by C and C++, and not very productive with them.

Link to comment
Share on other sites

Thanks, I ordered these for now from bookpool:

 

C Programming Language, The

Brian W. Kernighan

 

C++ How to Program

Harvey Deitel

 

C++ Programming Language Special Edition

Bjarne Stroustrup

 

I got some free online courses for c++ at work I'm taking too

Link to comment
Share on other sites

One of the problems I ran into on the online course was the following from the FIRST example:

 

 
#include <iostream.h> 

void main() 
{ 
cout << "Hello World!\n"; 
}

Well, using my trusty Linux Fedora Core 3 box and gcc/g++ and a lot of Google, the code ended up looking like this:

 

 
#include <iostream> 
using namespace std; 
int main(int argc, char* argv[]) 
{ 
       cout << "Hello World!\n"; 
}

 

I'm not sure if all of that was needed, but from the errors I was getting and Goggle finds, that is how it ended up looking. So it's a bit frustrating knowing the course is already out dated, and I can assume one or two of the books are going to be a bit out dated from what the standards are now.

 

BUT, I guess one thing to look at the "silver lining" is that having the error made me at least figure out what would work, :shrugs: I guess :D

Link to comment
Share on other sites

I'm not sure if all of that was needed, but from the errors I was getting and Goggle finds, that is how it ended up looking.  So it's a bit frustrating knowing the course is already out dated, and I can assume one or two of the books are going to be a bit out dated from what the standards are now.

The key compenent to make it work was:

 

using namespace std;

 

The code within function main is using cout, which is in the standard template library, which, in turn, is part of the std namespace. Namespaces are very important in C++, they help you manage very large project easier and prevent name conflicts. Thus, if you are using something from the std namespace, you have to declare that you are using the std namespace, or you have to specify it with std prefix, using the scope resolution operator, like so:

 

std::cout << "Hello World!\n";

 

When you go through Stroustrup's book, this will become crystal clear.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...