Programming Exercises

1:Write a program that counts the number of characters up to the first $ in input and that leaves the $ in the input stream.
2:Write a program that copies your keyboard input (up to simulated end-of-file) to a file named on the command line.
3:Write a program that copies one file to another. Have the program take the filenames from the command line. Have the program report if it cannot open a file.
4:Write a program that opens two text files for input and one for output. The program concatenates the corresponding lines of the input files, using a space as a separator, and writing the results to the output file. If one file is shorter than the other, the remaining lines in the longer file are also copied to the output file. ...

Get C++ Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.