C/C++ Pointer to a POD struct also points to the 1st struct member
问题 Can I assume that a C/C++ struct pointer will always point to the first member? Example 1: typedef struct { unsigned char array_a[2]; unsigned char array_b[5]; }test; //.. test var; //.. In the above example will &var always point to array_a? Also in the above example is it possible to cast the pointer to an unsigned char pointer and access each byte separately? Example 2: function((unsigned char *)&var,sizeof(test)); //... //... void function(unsigned char *array, int len){ int i; for( i=0;