Question: Project Linux C Program gcc Read in command line arguments Task: Read in command line arguments after file.c and execute the correct task file.c should

Project

  • Linux C Program gcc

  • Read in command line arguments

  • Task: Read in command line arguments after file.c and execute the correct task

  • file.c should have two variables ints from input x and xx

  • These variables will be filled through command line arguments

  • ex: file.c -a should print out hello world

  • ex: file.c [-a][-b x][-c xx] file2

-a prints Hello World

-b x takes in number to variable (x is number from input) default is 10

-c xx takes in larger number to variable(xx is number from input) default is 50

File2 is an input file containing one number per line

example:

1

2

8

Important - Use stderr an perror if other than above is inputted

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!