指针问题 待高手
1. 想将 -1 赋值给一个指针
如:
dynamic_buff_node_t* a = (dynamic_buff_node_t*)-1;
警告:warning: assignment from incompatible pointer type
2. 对void*类型的指针做运算
如:
void* p_elements; i_count = 5;
for (; i_count--; p_elements += 5){……}
警告:warning: pointer of type 'void *' used in arithmetic
3. 结构体中包含结构体,但是初始化有警告
如:
typedef struct a {int a;} A;
typedef struct b {struct ba; int b;} B;
typedef struct c {struct cba; int c;} C;
C test = {0};
警告:warning: missing braces around initializer
warning: (near initialization for 'cba.ba')
高手速速现身!