Hi guyz,
The following program doesn't output desired data (on VC2008 compiler)
#include <stdio.h>
#include <string.h>
int main(void)
{
int i;
int dest[10] = {1};
int src [] = {2, 3, 4, 5, 6};
memcpy(dest, src, 5);
for (i=0; i<10; i++) printf("%i\n", dest[i]);
return 0;
}
whereas using char
arrays instead, every thing goes fine!
where is the problem here?