TAB

C-Programming Objective Questions on Command Line Arguments

C-Programming Command Line Arguments

Hello Friends,
In environments that support C, there is a way to pass command-line arguments or parameters to a program when it begins executing. When main is called, it is called with two arguments. The first (conventionally called argc, for argument count) is the number of command-line arguments the program was invoked with; the second (argv, for argument vector) is a pointer to an array of character strings that contain the arguments, one per string. 
The simplest illustration is the program echo, which echoes its command-line arguments on a single line, separated by blanks. That is, the command
   echo hello, world
prints the output
   hello, world
By convention, argv[0] is the name by which the program was invoked, so argc is at least 1. If argc is 1, there are no command-line arguments after the program name. In the example above, argc is 3, and argv[0], argv[1], and argv[2] are "echo", "hello,", and "world" respectively. The first optional argument is argv[1] and the last is argv[argc-1]; additionally, the standard requires that argv[argc] be a null pointer.

 In Interview these kinds of questions will be asked in written Technical Round.
All type of questions which will be asked in written Technical round based on this topic is uploaded.


C-Programming Command Line Arguments

 If the Download link Appears to be broken or not Available please Comment Here or      Type your mail ID.
I will Share The Link Again or Mail You.

              Subscribe for Daily updates  And Join The Fresher Station Facebook Group.

No comments:

Post a Comment

Related Posts

Related Posts Plugin for WordPress, Blogger...