Discussion
What is the signature of the main function when using command line arguments ?
Answer: D
Correct answer: all of the mentioned
All three declarations are acceptable. char *argv[] and char **argv are equivalent, since an array parameter decays to a pointer to its first element.
Adding const is also permitted and is arguably better practice, since the program has no business modifying the strings the environment supplied. What the standard actually requires is only that the second parameter be a char ** or something that reduces to one, which all three do.
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