The arguments that we pass on to the main() function at the command prompt are called command
line arguments. In other word command line arguments are declared in to the
main function as a argument and used in command prompt to pass the information
i.e. the information contain in the command prompt is passed on to the program
through command line arguments.
Two arguments are contained by the main()
function that used in command prompt, first is argc and the second is argv. The
argc is a variable and also called argument counter. It is used to counts the
number of arguments on the command prompt. The argv is represents an array of
pointers to strings, also known as argument vector.
The size of argv is equal to the value of argc.
Sy:
main( int argc, char
argv[] )
{
………………..
………………………..
}
No comments:
Post a Comment