0

I know printf prints to "stdout" how exactly can I change the pointer to a class of mine that i'd prefer to handle the output string? or is it better to just process using sprintf and manage the strings? Would there be any issues with the first method?

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by rubberman
0

I know printf prints to "stdout" how exactly

By definition on the standard. Beyond that, don't know, don't care. Just need to know that it works....

can I change the pointer to a class of mine that i'd prefer to handle the output string?

What pointer?

0

>>By definition on the standard.

just to clarify, usually the standard are terminals in computers, but for other things, it could be definitely something else.

0

To print to another output stream using the C-style printf() functions, you would use fprintf(FILE* fp, const char* fmt, ...) function. However, for C++ it would be preferable to use output stream objects such as ostream, ofstream, ostringstream, etc. You can create your own output stream class that provides the behavior you want.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.