To print something without using cout, printf or puts()
is how the insertion operator (<<) is declared(overloaded) in the iostream.h header file. Can I possibly use the same function to print a string value on screen?
I tried
it ended up in error. I would like to use something like this in order to see if there is some possible way to answer this query of printing something on screen without using printf, cout or puts().
Update: I would welcome if you have any suggestions other than
NB: I have no restrictions if you can provide the C equivalent code that can print without a printf(), cout or puts()
| |||
system()
you are spawning a new process, a terribly expensive operation if its purpose is only to output something. Generally (perhaps always, I am not certain), that process is a shell and the shell will then spawn a second process (for the echo command, in your case), so doubling the expense which was likely unacceptable in its single cost. – mah Dec 3 '12 at 18:02