command_line_arguments

Command_line_argumen - Command-line arguments CS 201 Fundamental Structures of Computer Science Introduction A command-line argument is the

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

View Full Document Right Arrow Icon
Command-line arguments CS 201 Fundamental Structures of Computer Science
Background image of page 1

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

View Full DocumentRight Arrow Icon
Introduction A command-line argument is the information that follows the name of the program on the command line of the operating system Command-line arguments are used to pass information into a program when you run it They facilitate the use of your program in batch files They give a professional appearance to your program
Background image of page 2
Introduction C++ defines two built-in parameters to main() They receive the command line arguments Their names are argc and argv The names of the parameters are arbitrary. However, argc and argv have been used by convention for several years. They are optional
Background image of page 3

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

View Full DocumentRight Arrow Icon
int main( int argc , char *argv[] ) argc is an integer Holds the number of arguments on the command line Since the name of the program always corresponds to the first argument, it is always at least 1
Background image of page 4
int main( int argc, char *argv[] ) argv is a pointer to an array of character pointers. Each character pointer in the argv array corresponds a
Background image of page 5

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

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

This note was uploaded on 12/27/2009 for the course CS 201 taught by Professor Selimaksoy during the Fall '09 term at Bilkent University.

Page1 / 9

Command_line_argumen - Command-line arguments CS 201 Fundamental Structures of Computer Science Introduction A command-line argument is the

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

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