ECS 36B Lecture 8: Command Line Arguments
ECS 36B verified notes
8/26View all
Document Summary
Ecs 36b - lecture 8 - command line arguments. Basic way of taking input has been through scanf , but if we can also take input using the. Argc -- number of command line arguments that were passed through your program. This will be one or greater because the name of the program is always the first thing passed. Argv -- has those command line arguments documented as strings. If you want a non-string to be entered it still should be entered as a string you will just have to convert it after with sscanf. ** argc and argv should be how we get our inputs in the programs we write for homework 1** Files are special because they persist past the lifetime of your program. Whereas all your variables, function, and other running program features are killed. Opening a file we use fopen give a path and then follow it with the mode we.