Programming Exercises
Write a file copy program that takes the original filename and the copy file from the command line. Use standard I/O and the binary mode, if possible.
Write a program that sequentially displays onscreen all the files listed in the command line. Use argc to control a loop.
Modify the program in Listing 12.6 so that it uses a command-line interface instead of an interactive interface.
Programs using command-line arguments rely on the user's memory of how to use them correctly. Rewrite the program in Listing 12.2 so that, instead of using command-line arguments, it prompts the user for the required information.
Write a program that opens two files whose names are provided by command-line arguments.
Have the program print line 1 ...
Get C Primer Plus®, Third 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.