Question: Run the program below with 4 command line arguments of your own choosing, at least one of which is a flag and one of which
Run the program below with command line arguments of your own choosing, at least one of which is a flag and one of which is a nonflag argument. The program displays arex, addresses
a Record the command line that you used
b From the program output, report the base address the starting address of argy and range of addresses used store the command line.
Purpose: shows the arguments on the cod line ie: showArgs one two three c
#include stdio ba #include sunistd.h #include stdlibh
int mainint arge, char argxll.char enxplI
fprintfistdout, My name is s Im process #d
"I have d cod line argsinin". argx getRidO.arge:
Showing the command line aras
forint argvElatt
fprintfstdoutps pn
&argxlil. arexfil, arell:
fprintistdout, "Look at what's at location arglargs: location: p value: "pIn".
dargxIaras arexlargs:
systembash:
create a subshell to look at procpidcodline
fprintfstdout "We're back n: fprintfstdout
Just in time to leave!!! n:
return :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
