Using sample C++ code from a book...won't compile
Hey guys,
Just got C++ How to Program 3rd Edition by Deitel & Deitel and I'm trying to compile the following using gcc: Code:
// Fig. 1.2: fig01_02.cpp Code:
me@tux C++ $ gcc Fig01_02.cpp |
Try compiling using g++ instead of gcc.
|
I assume you compiling using g++ instead of gcc?
Code:
// Fig. 1.2: fig01_02.cpp |
Cool g++ worked...I assume this book is out of date? looks like its from 2001
|
The code is not invalid according to the C++ standard and the change suggested by michaelk is not necessary at all,
it only tells us michaelk doesn't know much about namespaces. You should be fine with that book. Just remember to compile c++ programs with g++ and c programs with gcc. |
All times are GMT -5. The time now is 11:12 PM. |