Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Answers were Sorted based on User's Feedback



In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / sanish joseph

No guys the ans s 2
it prints d program name:
arguments counts only from 1 nd nt 4m 0

Is This Answer Correct ?    15 Yes 0 No

In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / ram

The answer is the program name.

Is This Answer Correct ?    11 Yes 0 No

In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / 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

In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / 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

In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / zubeir

the answer is 1st choice.

Is This Answer Correct ?    8 Yes 8 No

In the following declaration of main, "int main(int argc, char *argv[])", to what does a..

Answer / mahi

my ans is 2.it prints the program name

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More OOPS Interview Questions

What is multilevel inheritance explain with example?

0 Answers  


Why do pointers exist?

0 Answers  


what are the ways in which a constructors can be called?

0 Answers  


Can destructor be overloaded?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,






Advantage and disadvantage of routing in telecom sector

0 Answers  


Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku

4 Answers  


which is best institute to learn c,c++ in ameerpet hyderabad

1 Answers  


#include <iostream> using namespace std; int main() { int a = 2; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][c[1][4]]; }

2 Answers   TCS, Wipro,


tel me oops defination in single line

2 Answers  


write a progra in c++ using class & object to find out wheather a given no. is prim or not.

2 Answers  


What is class and object in oops?

0 Answers  






Categories