Eric,
I did compile and run Matt's code under Turbo C and Quick C with no problems. His program is the simplest code which is guaranteed to run under ANSI compliant C.
see http://www.lysator.liu.se/c/simple-c
Now to correct an error I made...
Your example is valid under DOS, etc... In your code argc is a integer which is the number of command line parameters and argv is a pointer to an array of pointers to arrays of characters. These strings are the command line parameters entered by you when you run the executable.
see: http://www.lysator.liu.se/c/multiple-level
Without adding this, Matt is unable to access command line parameters which is OK because we will not be running under DOS anyway...
As I said... Your code also works... I did not mean to start a fight here.
Peace.
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
Last edited by Mike Betts : 11-10-2003 at 12:58.
|