Discussion
What is the second argument in command line arguments?
Answer: B
Correct answer: A pointer to an array of character strings that contain the arguments, one per string
The second parameter is argv. Declared char *argv[] it is an array of pointers, and as a parameter it decays to a pointer to its first element, which is how char **argv comes to be an equivalent declaration.
Each element addresses one null-terminated argument, with argv[0] naming the program and argv[argc] guaranteed null. The first parameter, argc, carries the count of those strings.
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