C将结构中的数组和指针初始化为相同的值
C initialising both an array and a pointer in struct to the same value
如题,是否可以在一个struct中初始化一个指针,使其指向同样在同一个struct中的数组的第一个元素?
struct foo
{
int barr[12];
int* barr_itt;
};
struct foo f = {{0}, /*.?.*/}
是,使用变量名
struct foo f = {{0}, f.barr} ;
如题,是否可以在一个struct中初始化一个指针,使其指向同样在同一个struct中的数组的第一个元素?
struct foo
{
int barr[12];
int* barr_itt;
};
struct foo f = {{0}, /*.?.*/}
是,使用变量名
struct foo f = {{0}, f.barr} ;