Computer Science 2574
Intro to Data Structures & Soft Eng


Fall 1999 Example Code


Command-line Argument Examples

The following are short, mostly undocumented, C++ source examples.  All code compiles in Visual C++ and executes as described under Windows NT.

Description Files
Illustrates how to retrieve a file name from the program command-line, open it, and test whether the file exists. here
Illustrates how to use int and char command-line arguments, converting ascii string to an int, and simple argument validation. here

 

Pointer Examples from Class and the Notes

The following are short, mostly undocumented, C++ source examples.  All code compiles in Visual C++ and executes as described under Windows NT.

Description Files
Precedence of '*' and '.' when using a pointer to a struct variable. here
Array of pointers to struct variables. here
Declaring and deleting an array dynamically. here

 

"Nothing is so annoying as a good example."

- Mark Twain

 

W D McQuain 9/20/1999 Virginia Tech © 1995-1999