cfans
asked on
C strings strncpy and memcpy
I'm having a problem with C strings I can't understand it..
I'm trying to get a section out of a string..
char section[5];
char tempString[32] = "123456ABCDEFGHIJKLMNOPQRS TUVWXYZ";
memcpy(section, tempString + 16, 5);
printf("%s", section);
I get KLMNOÖÿ¿`X@
I'm trying to get a section out of a string..
char section[5];
char tempString[32] = "123456ABCDEFGHIJKLMNOPQRS
memcpy(section, tempString + 16, 5);
printf("%s", section);
I get KLMNOÖÿ¿`X@
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.