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
Which method cannot be overridden?
What is encapsulation with example?
Why do we use polymorphism?
What is a function in oop?
What is overriding in oops?
What is destructor in oop?
write string class as your own class in java without using any built-in function
What does it mean when someone says I oop?
Why is encapsulation used?
Why is polymorphism needed?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is and I oop mean?
What is the use of oops?
What are the components of marker interface?
What are the 4 pillars of oop?