M
Marcelo
Hi,
I have a declaration like the following:
char tmp[8];
char tmp2[5];
strcpy (tmp, "58257619");
strcpy (tmp2, "");
Now, I'd like to copy the last five digits from tmp to
tmp2. I've tried doing a for loop, but there's always
garbage at the end of tmp2, and when the function returns,
it says that the memory near tmp was corrupted. Can
someone help me on how this should be done?
TIA
marcelo
I have a declaration like the following:
char tmp[8];
char tmp2[5];
strcpy (tmp, "58257619");
strcpy (tmp2, "");
Now, I'd like to copy the last five digits from tmp to
tmp2. I've tried doing a for loop, but there's always
garbage at the end of tmp2, and when the function returns,
it says that the memory near tmp was corrupted. Can
someone help me on how this should be done?
TIA
marcelo