questions about library functions
Posted: Thu Jan 23, 2003 8:11 pm
im using two library functions for working on strings. memcpy, and memcmp.
now, does memcpy put 0's, or some uniform value in the unused spaces of the array? ie. if you have a 15 char arry, wiht only the first 6 slots being filled be legit chars, and you copy it into another 15 char arry, will the last 9 chars in the array be filled wiht a uniform value? the reason im asking is that when i use memcmp on a string to see if it matches with another, if memcpy dosnt put a uniform value in each unused slot, then it will be filled with junk, and memcpy wont work right, even though they have teh same string. if im being unclear about my question please tell me.
now, does memcpy put 0's, or some uniform value in the unused spaces of the array? ie. if you have a 15 char arry, wiht only the first 6 slots being filled be legit chars, and you copy it into another 15 char arry, will the last 9 chars in the array be filled wiht a uniform value? the reason im asking is that when i use memcmp on a string to see if it matches with another, if memcpy dosnt put a uniform value in each unused slot, then it will be filled with junk, and memcpy wont work right, even though they have teh same string. if im being unclear about my question please tell me.