i need help in writing...........
a C program (not a C++ program!) that utilizes
all three arguments available to the main function:
int main( int argc, char *argv[], char *env[] )
Where:
argc = the number of arguments passed to the program
argv = a pointer to an array of the actual contents of
the arguments
env = a pointer to an array of environment variables
passed to the program by the Operating System.
1. Loop through the argument array (argv) and
print each of the command line arguments to the
standard output.
2. Test each command line argument to see if the
first character is an integer (using isdigit(...) ).
If the first characer is a digit, then print a line
“argv[i] is an integer”. Otherwise print a line
“argv[i] is a character array”
3. Print out a number that is the summation of
all arguments whose values are integer.
4. Loop through the environment variable array
(env). Print the following to the standard output,
labeling appropriately:
a. the first environment string.
b. the value associated with the "HOSTNAME"
variable. The strtok(...) or strtok_r(...) function
may be helpful.
c. The value associated with the "USER"
variable.
d. The last environment string.
5. Print a count of how many environment
variables there were.
thnx in advance