Reading from Stdin in C++by Jeffrey P. BighamThe following code reads each line from the standard input (stdin) and outputs it on standard out (stdout). By using strings as opposed to char* we don't have to worry about overflowing the input buffer and can handle long lines effortlessly. The code:
Compile with:
Run with:
Related Articles |
|