1.

To use command line arguments in C++, how many parameters are passed to the main function?(a) 1(b) 2(c) 3(d) 4I have been asked this question during an interview for a job.Question is taken from Command Line Arguments topic in chapter C++ Advanced of C++

Answer»

The correct answer is (b) 2

The explanation is: 2 ARGUMENTS are needed to be PASSED to main() FUNCTION while using command line arguments. The first one represents a number of strings in the argument LIST and the second list represents the list of string arguments.



Discussion

No Comment Found

Related InterviewSolutions