struct MyStruct
{
int i;
};
int main(int argc, const char* argv[])
{
struct MyStruct test;
struct MyStruct* p = &test;
p->i = 100;
(*p).i = 66;//这两种等价
printf("%d\n",(*p).i);
printf("%d\n", p->i);
}
结构体指针赋值
最新推荐文章于 2024-08-10 20:43:59 发布