Question: How do I complete this program based on command lines using C? Here's the assignment given: And here's the skeleton program given: #include #include void
How do I complete this program based on command lines using C?
Here's the assignment given:
And here's the skeleton program given:
#include
void readfile(char * filename);
int main(int argc, char **argv){ //argv[0] is the program name //argv[1], argv[2], argv[3] are the 1st, 2nd, and 3rd argument in the command line arguments
if(argc
return 0; }
//function for -f reading a file void readfile(char * filename) { //implement your file reading }
Procedure Write a C program Ex02.c that performs one of the four operations based on command line arguments to the program. Please DO NOT use string libraries on this assignment. The possible command line options and the associated operations are as follows: Option "-a 12 30": read two integers from the command line arguments and output the sum of the two integers O Example: ./Ex02 -a 12 30 o Output: 42 Option"-f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
