whats for the console output?

A

All Rise

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

Carl Daniel [VC++ MVP]

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
 
A

All Rise

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?
 
C

Carl Daniel [VC++ MVP]

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
 
A

All Rise

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




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top