Discussion
Which standard library function will you use to find the last occurrence of a character in a string in C?
Answer: D
Correct answer: strrchr()
strrchr() - the extra r is for reverse - returns a pointer to the last occurrence of a character in a string, or NULL if it is absent. It is the usual way to find a file extension or the last separator in a path. The other three names do not exist; strchr() finds the first occurrence.
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