Discussion
Which of the following is the right syntax to copy n characters from the object pointed to by s2 into the object pointed to by s1?
Answer: A
Correct answer: void *memcpy(void *s1,const void *s2,size_t n);
The destination comes first, as it does throughout the library - the same order as an assignment. The source is const, since it is only read, and the function returns void *, the destination pointer, so calls can be chained. The two regions must not overlap; memmove is the version that copes if they 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