C++typedef struct和struct的区别

#include "pch.h" #include struct struct1 { int a; char b; char* c; }test1;//定义结构体变量 typedef struct struct2 { int a; char b; char* c; }test2;//定义结构体类型 int main() { test1.a = 10; test2 *t2=new test2(); t2->a = 20; }
posted @ 2019-06-26 10:50  枫影竹韵  阅读(1376)  评论(0编辑  收藏  举报