Hi guys,
I had an issue wrt memcpy in my code...Pls find the snippet of code below
Code:
#define ARR_LEN 100
char arr_ca[ARR_LEN + 1 ];
arr_ca[ARR_LEN]= {'\0'}; // Initialising the last element of the string
memset(arr_ca,0x00,sizeof(arr_ca));
memset(arr_ca, "Checking the text", ARR_LEN);
When i debug the above prgm and check the value of arr_ca it gives
"Checking the text \00\00\00 asjdlkjewiruioiuoiuasdsd .(some junk value).."
I am not getting as to why am i getting junk value since i have already initiliased arr_ca using 0x00 in step 3...Can anyone explain me on this!!!