argv and argcargc for a program invoked with:
% a.out 100 0
% a.out
% ls -la
% cp file1 file2a
% cp file1 file2a
argc?
argc?
argv array
associated with the following command line?
% vim prog.source.c
argv array?
argv for the command line:
% simulate 100 -12
% a.out -filename xyz -verbose
A. Which string does argv[2] refer to?
*(argv[1] + 2) ?
% prog3 300 5 -Quiet
Write a C code fragment that changes the
upper case 'Q'
to a lower case 'q'.
% process <n> <filename>
where <n> is replaced by an integer value,
and <filename> is the name of a file.
If the following code represents the C source code
that is compiled to be the executable called process,
what is wrong with the code?
#include <stdlib.h>
main(int argc, char *argv[]){
int n;
n = atoi(argv[1]);
}
Show how to fix this code (fragment).
| Copyright © Karen Miller, 2007 |