CS 2213 Advanced Programming, Spring 2001 Lab Assignment 6


Due Thursday, March 22, 2001


Write a main program that takes exactly one command line parameter. The program should start by printing a line containing your name. It should then check for the correct number of command line parameters and print an appropriate error message and exit if this number is not correct.

It should then print one line giving the command line parameter and its length. The length of the parameter is the number of characters in the parameter, not including the terminator. You may use strlen.

All output should be to standard output.

Run lint on this program and make sure there are no warnings that should not be there.

For example, if I wrote the program called lab6.c and executed
lab6 hello
the output would be:
This program was written by Steven Robbins.
The parameter was hello and has length 5.

Send the complete code to the cs2213 account using the subject line:
cs 2213 lab assignment 6
Also include the output generated by running the program with the parameter hello as above and the output from running lint. Make sure each of these is appropriately labeled.

Be sure that you use cut and paste. Do not send your results as an attachment which assumes a particular type of mail reader. Use a mailer that does not wrap lines before position 80. Make sure you send this to cs2213 and not to srobbins.