Broadcom Interview Question: Implement strcpy function and... | Glassdoor

Interview Question

Embedded Software Engineer Interview San Diego, CA

Implement strcpy function and show me if there are any

  limitation of this function. what if the 2 buffers passed to the strcpy function overlaps ?

Interview Answer

2 Answers


In strcpy even if the buffer overlaps , we can do successful data copy if we change the order of copying.(in reverse order or forward order)

Interview Candidate on Jul 20, 2011

If copying takes place between objects that overlap, the behavior is undefined.

Anonymous on Dec 8, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.