1402 19 - 3/17/2010 1 COMP 1002/1402 Introduction to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3/17/2010 1 COMP 1002/1402 Introduction to Systems Programming Chapter 19: Command line Arguments Notes Adapted from Dr. J. Morrison, Dr D. Nussbaum Purpose At times a program needs to know some information during startup. Examples: A gaming program needs to know the maximum number of players that will participate. A file copy program needs to know the input file (from file) and the output file (to file). A bilingual program needs to know in which language to present the information to the user. COMP1002/1402 - Chapter 19: Command-line Arguments 2 3/17/2010 2 Examples Manual pages: man printf List the files in the directory: ls l Copy files: cp infile outfile Compiling using make: make f myMakeFile COMP1002/1402 - Chapter 19: Command-line Arguments 3 What is Needed Transfer the required input from the command line: > program arg1 arg2 arg3 The operating system, which starts the program must transfer the parameters to the...
View Full Document

Page1 / 5

1402 19 - 3/17/2010 1 COMP 1002/1402 Introduction to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online