Discussion
Assertion (A) : char str[] = "paper"
'str' acts as a constant pointer to a string.
Reason (R) : *P = "Paper"
"P" acts as a pointer to a constant string.
Answer: B
Both statements are true but the reason does not explain the assertion, which is option (B). In char str[] = "paper" the name str is the address of the first element of the array and cannot be changed, so it behaves as a constant pointer to the string. In the reason, P is a pointer that is made to point at a string constant, so it is a pointer to a constant string. The two describe different declarations, so one does not explain the other, which rules out (A), and neither statement is false, which rules out (C) and (D).
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