Is The Book "C++ Primer : 4th Edition" Outdated.

Started by
4 comments, last by vcjr 14 years, 3 months ago
Is The Book "C++ Primer : 4th Edition" Out dated. Ok I Just received my copy from Amazon.com of this book and from my little espirience is that when i look at the code from the book something is missing " what you ask" well this part using namespace std; i sopose that this is a nessary comand or not? because im no expert i just whant to know if this is going to be a problem? ps. sorry for my grammar and spelling english is not my first language.
____________________________________________________________Signature: my site http://7skysproductions.netai.net/blog/wordpress/
Advertisement
That doesn't mean the book is out of date, that is more of a preference, a lot of people don't seem to use namespace for reasons like say an engine has there own string, name this engine FOO, so if you were to do using namespace std; and using namespace FOO; and you try and use string you have a problem since both namespaces has this in it. If you left out both you could separate the two, FOO::string and std::string.
using namespace std;

means that the programm will include the namespace when compiling (not entirely sure on what exactly happens, but that is what I belive happens).

It basically means that instead of having to write:
include <iostream>int main() {std::cout << "Saying something";std::cout << "...and some more" << std::endl;return 0;}


You can write:
#include <iostream>using namespace std;int main() {cout << "Saying something";cout << "...and some more" << endl;return 0;}


See the difference? :-)
Hope it makes sense.
thanks now i know it just make coding easier. thanks
____________________________________________________________Signature: my site http://7skysproductions.netai.net/blog/wordpress/
Books often take shortcuts so the code can fit on a printable page.
-- gekko
ok thanks everyone for your help.
____________________________________________________________Signature: my site http://7skysproductions.netai.net/blog/wordpress/

This topic is closed to new replies.

Advertisement