Step 2: Using a C struct

In this step, you will modify main() to create a local variable of type Record (which you just defined), and initialize it from the command-line arguments.

Add to main() a declaration for a local variable called myRec of type "Record". The m_firstName, m_lastName, and m_age should be assigned via the "dot notation" method of accessing structure members. You should use the first real command-line argument (the 0th one is the name of the program, so ignore that) as the first name, the next argument as the last name, and the next argument for the age. (Since command-line arguments are all C-strings, you need to convert the age from a string, e.g. "47", to the int 47--use the function atoi(), in the library (it takes a "char *" as an argument, and returns the equivalent int value).

Lastly, add code to dump out the values in the members of myRec, with meaningful labels. You will be reusing this code several times more later, by cutting-and-pasting it into other places.

We will add more code to main() in later steps.