C Review Recitation Handout Monday, Oct 4
Activity 0: Reading man pages
– Either type man getopt on your Terminal or Google ¡°man getopt¡±.
– int getopt(int argc, char * const argv[], const char *optstring); What does getopt do?
Copyright By PowCoder代写 加微信 powcoder
Describe the parameters that getopt takes: – int argc:
– char * const argv[]:
– const char *optstring: What does getopt return?
Other specifications about getopt:
Note: use this template to understand other C functions/man pages as well! Activity 1: getopt_example.c
In this first activity, we have given you a file called getopt_example.c. Your task is to figure out what this program does!
What does getopt_example.c do?
How do you get the program to process arguments (i.e. formatting specifics?)
What does the -v argument do? The -n argument?
To compile all files, type:
$ make clean
To compile just the example, type:
$ make getopt_example
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com