whats for the console output?

  • Thread starter Thread starter All Rise
  • Start date Start date
A

All Rise

If I cant or should not use cout, whats the alternate for outputting to the
console in c++. Printf() ?
 
All said:
If I cant or should not use cout, whats the alternate for outputting
to the console in c++. Printf() ?

std::cout is "the C++" way to write to the console. If you can't use the
C++ way, there's "the C way", via printf (or fprintf, etc), or the "windows
way", via WriteFile and the Console API functions.

-cd
 
yeah I know these ways thanx, but when I use cout, I get
following warning:

d:\Program Files\Microsoft Visual Studio .NET\Vc7
\include\useoldio.h(29): warning
C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as
#pragma deprecated

so thats why I'm asking that if the compiler recommends
that I do not use cout, then what should I use?
 
Ah. Then you should use new IOStreams.

#include <iostream> instead of <iostream.h>. you'll then need a 'using
namespace std;', or you'll need to refer to std::cout instead of cout.

-cd
 
Cool, thanx :)
-----Original Message-----
Ah. Then you should use new IOStreams.

#include <iostream> instead of <iostream.h>. you'll then need a 'using
namespace std;', or you'll need to refer to std::cout instead of cout.

-cd




.
 
Back
Top