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
What are the advantages of polymorphism?
What is encapsulation in oops?
How do you define social class?
Why multiple inheritance is not possible?
What is overriding in oop?
What is interface? When and where is it used?
What is the significance of classes in oop?
What is an interface in oop?
Why do we use oops?
What do you mean by abstraction?
Can a varargs method be overloaded?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What does <> mean pseudocode?
What exactly is polymorphism?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.