Hi All,
I have a following code .
Two queries here are.Code:1 #include <stdio.h> 2 #include <stdint.h> 3 4 struct temp 5 { 6 char sa_data[10]; 7 8 }; 9 10 int main() 11 { 12 unsigned char *c; 13 struct temp test; 14 static int32_t var; 15 16 c = &test.sa_data[0]; 17 18 test.sa_data[0] = 0xAB; 19 var = c[0]; 20 21 printf("%x %x \n",c[0],var); 22 23 return 0; 24 }
1. At line number 16, we are assigning address of sa_data[0] to unsigned char and while printing we are not using '*' , how it can still print the value of the variable instead address..?
2. when i am trying to assign int32_t data type variable with unsigned char pointer ,why it does not throw any type cast warning in compilation?.
Thanks in advance.