Discussion
What does the first parameter of the main function represent?
Answer: A
Correct answer: Number of command line arguments
The first parameter is argc, an int giving how many arguments the program was invoked with - the program name included, so a bare invocation gives 1.
The list of the arguments themselves is the second parameter, argv. C has neither dictionaries nor stacks as language constructs, so those options describe nothing the runtime could supply. The count exists because the array itself carries no length, only a null pointer at its end.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development