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 ?    12 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

Is abstract thinking intelligence?

0 Answers  


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

0 Answers   SRA,


How do you define social class?

0 Answers  


what is main difference between object oriented object base

2 Answers   Wipro,


can you give real time example for polymarphism

5 Answers   TCS,






How to create a comment page in C #??

2 Answers  


What is the point of oop?

0 Answers  


can we make game by using c

1 Answers   SmartData,


What is abstract class in oops?

0 Answers  


What is the difference between the C & C++?

9 Answers   HCL,


what is the difference between ERROR and EXCEPTION?

14 Answers   NIIT, nvidia,


what's the basic's in dot net

0 Answers   informatics,


Categories