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 / sumeet sharma

argv[o] the array of strings will point to the name of the
program.
argv[1] will point to the first argument and so on.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

c++ program to swap the objects of two different classes

1905


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.

1558


Is oop better than procedural?

657


write a programe to calculate the simple intrest and compund intrest using by function overlading

1761


what are the realtime excercises in C++?

2431






what is the drawback of classical methods in oops?

3001


What is the important feature of inheritance?

728


What is the real time example of encapsulation?

686


What is encapsulation c#?

696


#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3366


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4044


What polymorphism means?

703


What makes a language oop?

706


What is this pointer in oop?

652


What is polymorphism programming?

694