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