Discussion
Which of the following is correct about the first parameter of the main function?
Answer: D
Correct answer: All of the mentioned
All three statements hold. argc is declared int; it stores the count of command-line arguments; and it is non-negative, since a count cannot be less than zero.
In practice it is at least 1, because the program name occupies argv[0] and is counted. The standard does allow 0, in which case argv[0] is a null pointer, but that arises only from an exec call supplying no name at all - never from an ordinary shell.
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