A
akarui.tomodachi
I have two structure definitions as below:
typedef struct _sourceString
{
char firstSourceString[20];
char secondSourceString[20];
char thirdSourceString[20];
}sourceString;
typedef struct _destinString
{
char firstDestinString[20];
char secondDestinString[20];
char thirdDestinString[20];
}destinString;
in the code.......
/********************
sourceString* mySource;
destinString* myDestin;
mySource->firstSourceString = "ABC 123";
mySource->secondSourceString = "ABC 123";
mySource->thirdSourceString = "ABC 123";
strcpy(myDestin->firstDestinString, mySource->firstSourceString);
strcpy(myDestin->secondDestinString, mySource->secondSourceString);
strcpy(myDestin->thirdDestinString, mySource->thirdSourceString);
**********************/
The above "strcpy" is ok until I ported this code to a small embedded
system, where TIME is a critical factor. This type of copying by using
"strcpy" takes longer process time and creates all bunch of problems
related to delay.
However, how can I copy my source strings to the destination string
buffers without using strcpy (or memcpy) faster ?
typedef struct _sourceString
{
char firstSourceString[20];
char secondSourceString[20];
char thirdSourceString[20];
}sourceString;
typedef struct _destinString
{
char firstDestinString[20];
char secondDestinString[20];
char thirdDestinString[20];
}destinString;
in the code.......
/********************
sourceString* mySource;
destinString* myDestin;
mySource->firstSourceString = "ABC 123";
mySource->secondSourceString = "ABC 123";
mySource->thirdSourceString = "ABC 123";
strcpy(myDestin->firstDestinString, mySource->firstSourceString);
strcpy(myDestin->secondDestinString, mySource->secondSourceString);
strcpy(myDestin->thirdDestinString, mySource->thirdSourceString);
**********************/
The above "strcpy" is ok until I ported this code to a small embedded
system, where TIME is a critical factor. This type of copying by using
"strcpy" takes longer process time and creates all bunch of problems
related to delay.
However, how can I copy my source strings to the destination string
buffers without using strcpy (or memcpy) faster ?