adding an integer to a char array in c -
adding an integer to a char array in c -
it may silly question still not getting it. have char array char arr[100] having data
char arry[100] ---- data; int test; memcpy(&test,array+4,sizeof(int))
what memcpy skp
it re-create element array[4]
variable test
. on 32-bit machine sizeof(int)
= 4
. memcpy
re-create 4
bytes address &test
can hold 4
bytes.
c
Comments
Post a Comment