Old C++ book - Newer C++ tutorials

Hello, this is my first post and I've started to learn C++. I noticed that the book I'm using was published in 1995. Then I started looking at newer tutorials like the famous "Hello World" for beginners.

In the book the code is:


1
2
3
4
5
6
#include <iostream.h>
main () {
 cout << "The volume of the box car is ";
 coun << 11 * 9 * 40;
 coun << endl;
}


And on this website the code was:

1
2
3
4
5
6
7
#include <iostream>

int main()
{
    std::cout << "This is a native C++ program." << std::endl;
    return 0;
}


I'm beginning to notice differences with the past and current versions of C++. Or am I wrong, are these just different methods of programming in C++? Does it matter if I use an older book on C++?


Thanks for any replys, these questions may make me look stupid, but I'm a noobie to C++.


P.S.
If you need the book's title and author it's On to C++ by Patrick Henry Winston
Last edited on
> Does it matter if I use an older book on C++?

Yes, it does. Especially if it is one published in 1995.

Ideally, get a current book; for instance, C++ Primer 5th Edition (Lippman, Lajoie, and Moo)

Or at the very least, one published after 1998.

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
Okay, thanks for the reply! I'll either get that book or I'll use the online tutorial on this site.
Get a book. The online tutorial on this site is nowhere near adequate.

Slightly dated (does not cover things added in C++11), but Eckel's 'Thinking in C++' is available as a free ebook. http://mindview.net/Books/TICPP/ThinkingInCPP2e.html

A comprehensive online tutorial (which assumes familiarity with C):
http://cppannotations.sourceforge.net/annotations/html/
Last edited on
In the second example you can put the line: using namespace std; above the main. That way you can just type cout<< instead of std::cout<<
Topic archived. No new replies allowed.