In the following declaration of main, "int main(int argc,
char *argv[])", to what does argv[0] usually correspond?
1) The first argument passed into the program
2) The program name
3) You can't define main like that
Answer Posted / vadivel
If the value of argc is greater than 0, the array members
argv[0] through argv[argc-1] inclusive shall contain
pointers to strings, which will be the command line
arguments. argv[0] will contain the program name, argv[1]
the first command line arg, argv[1] the second and so on.
Finally, argv[argc] is guaranteed to the a NULL pointer,
which can be useful when looping through the array.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why do we use polymorphism in oops?
What does enum stand for?
What are main features of oop?
What is abstraction example?
What are the components of marker interface?
What is polymorphism give a real life example?
What is difference between abstraction and encapsulation?
What is the point of oop?
What are the 4 pillars of oop?
What is a superclass in oop?
What is oops concept with example?
What is difference between polymorphism and inheritance?
What is oops with example?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer