[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [G++ n00b] getche() in G++ ?

From: Stefan Kristensen
Subject: Re: [G++ n00b] getche() in G++ ?
Date: Fri, 02 Nov 2007 12:30:35 +0100
User-agent: Thunderbird (Windows/20070728)

When compiling with g++, it warns me that <iostream.h> is deprecated,
but when using <iostream> I get an error that cout is undefined. Also,
there is no man for cout. Should I use something else in stead of cout?

You should indeed be including <iostream> rather than <iostream.h>. Then, be aware that most (all?) of the standard headers - i.e. the ones without the ".h" - put everything in the namespace "std", so e.g. you have to reference cout as std::cout.

Darn! My book doesn't mention namespaces at all... Good thing I've reserved another book at the library.

Thank you all for your input. I'll be back, I promise ;-)

Best regards

reply via email to

[Prev in Thread] Current Thread [Next in Thread]