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; }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM