Discussion
In linux, argv[0] by command-line argument can be occupied by _________
Answer: D
Correct answer: all of the mentioned
argv[0] holds the name by which the program was invoked, and on Linux that is whatever string the user typed to run it - whether ./a.out, ./test or anything else.
The name has no necessary connection to the source file, and a program can be renamed freely. It is not even guaranteed to be a real filename: a shell or an exec call can supply any string it likes, which is what lets a single binary behave differently under several names, as busybox does.
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