[SOLVED] CSC415 -Assignment 1 – Command Line Arguments

30.00 $

Category:

Description

5/5 - (1 vote)

Let me set some of the expectations.  Code should be neat, well documented.  Variables should have meaningful names and be in a consistent format (I do not care if you use camelCase or under_scores in variables but be consistent.

This program is to demonstrate the usage of command line arguments in a C program.  You will write this to run in the Linux virtual machine.  The program should display the number of arguments from the command line and list each one on the console.

Here is a sample execution:

“`
student:~/CSC415$ make run RUNOPTIONS=”Hello, these are overridden options 3 6 9″
gcc -c -o bierman_robert_hw1_main.o bierman_robert_hw1_main.c -g -I.
gcc -o bierman_robert_hw1_main bierman_robert_hw1_main.o -g -I.
./bierman_robert_hw1_main Hello, these are overridden options 3 6 9

There were 9 arguments on the command line.
Argument 00:     ./bierman_robert_hw1_main
Argument 01:     Hello,
Argument 02:     these
Argument 03:     are
Argument 04:     overridden
Argument 05:     options
Argument 06:     3
Argument 07:     6
Argument 08:     9
student:~/CSC415$
“`

Your write-up should include a description of the project and what you did, issues you had, how you overcame the issues and the compilation and execution output from your program (screen shots embedded in the PDF document. Your execution output should include commands with the command-line arguments.

All filenames should be `<lastname>_<firstname>_HW<#>_<component>.<proper extension>`
So my filename would be `Bierman_Robert_HW1_main.c`