Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/28/04 10:38
Read: times


 
#78246 - RE: Keil strncpy function doubt?????
Responding to: ???'s previous message
Dear All,


I just went through both the commands on the keil site.

memcpy says
memcpy
Summary
#include <string.h>

void *memcpy (
void *dest, /* destination buffer */
void *src, /* source buffer */
int len); /* bytes to copy */


Description
The memcpy function copies len bytes from src to dest. If these memory buffers overlap, the memcpy function cannot guarantee that bytes in src are copied to dest before being overwritten. If these buffers do overlap, use the memmove function.

and strncpy says
strncpy
Summary
#include <string.h>

char *strncpy (
char *dst, /* destination string */
char *src, /* source string */
int len); /* max characters to copy */


Description
The strncpy function copies at most len characters from src to dst.

Here nothing of overlaping was mentioned in strncpy so I thought it is safer to use strncpy.

But for my code both the functions will function same.
Kindly correct me!


Thanks
Sachin


List of 26 messages in thread
TopicAuthorDate
Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
            Encoder Direction            01/01/70 00:00      
               RE: Encoder Direction            01/01/70 00:00      
                  RE: Encoder Direction            01/01/70 00:00      
                     RE: Encoder Direction            01/01/70 00:00      
                        RE: Encoder Direction            01/01/70 00:00      
                           RE: Encoder Direction            01/01/70 00:00      
                              RE: Encoder Direction            01/01/70 00:00      
                     RE: Encoder Direction            01/01/70 00:00      
                        Thanks a *            01/01/70 00:00      
                        Need help for low ESR Capacitors            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Programming style            01/01/70 00:00      
      RE: Programming style            01/01/70 00:00      
      RE: Programming style            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
   Copying structures            01/01/70 00:00      
      RE: Copying structures            01/01/70 00:00      

Back to Subject List