在以下场景中,我如何通过指针 c 获取数组
a 的大小(3)?解决这种问题的模式是什么?
struct struct_point {
int x;
int y;
int z;
};
typedef struct struct_point point;
int test_void_pointer () {
point a[3] = {{1, 1, 1}, {2, 2, 2}};
void * b;
point * c;
b = a;
c = b;
/* get_size_p (c) */
}
字节
还是元素数量为单位感兴趣? - haccks