If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Why be suspicious because of using namespace std? (BTW, the book also told me I could omit that line and write std::cout <<... but that is a little tiresome if I have to do it for every command )
The std namespace has lots of stuff in it and by using namespace std you're reasonably likely to get a namespace collision.
For example, the std namespace has something in it called 'count', which effectively means you cannot declare something else called count as the compiler would not know what you are refering to, std::count or just your count.
if you don't want to have to type std::cout the whole time you can do
Code:
using std::cout;
Which does the same thing but just for std::cout and not the whole namespace.
I tend to use german names for my variables, functions, etc, because that makes distinction between my own and the language's names even easier, so I guess the risk for me will be low
BTW, the book is "GoTo C++ Programmierung" be André Willms, published by Addison-Wesley.
This compiler doesn't follow 100% C++ standards, but it's sure something to look at.
Do you remember the games using DOS4GW under DOS? Well all games were coded using Watcom.
cu/2 magog - Germany - flying with OS/2 Warp speed...in a vehicle named eComStation (eCS)
---
Author of the Java Movie Database - http://www.jmdb.de
JMDB v1.35 FINAL is available (2007-09-20)
Homepage: http://www.juergen-ulbts.de/
Comment