
On Wed, 2005-01-26 at 11:14, Jodi Anderson wrote:
I've been teaching myself C++ lately and have been compiling at home on a RH6.1 box which has libstdc++ 2.9.0 The tutorials I have been using say to include <iostream.h> and cin/cout for standard input/output. I'm back at work after leave and am continuing my learnings now compiling on FC3 with libstdc++ 3.4.2 which gives me warnings about using depreciated headers with iostream.h. So I do what it says and remove the .h. This kicks back errors telling me that 'cin/cout is undeclared in function xyz A bit of a google and I find a page which says to add 'std::' to the cin/cout. I do this and things compiles fine. However I can't seem to find any info as to whether I need to add this all the time using the later libraries, or whether there is something extra I need to add/include in the source files
So to cut a long story short my question is: do I continue using std::cin/cout? Or is there something else I need to include?
gcc/g++ 3 has got considerably tighter than the older 2.95 version used for ages. add using namespace std; at the top of your source files, and everything will 'default' to having a std:: prefix. John