typedef_struct與struct之間的區(qū)別
#include <iostream>
using namespace std;
void main()
{
int x;
//MSG1作為結(jié)構(gòu)A的別名
typedef struct A{
int age;
char s;
}MSG1,*p1;
MSG1 msg1 ;
msg1.age=10;
p1 point =&msg1;
//msg2作為結(jié)構(gòu)B的變量
struct B{
int age;
char s;
}msg2,*p2 = new B;
msg2.age = 3;
p2->age=4;
//
cout<<(*point).age<<endl<<msg2.age;
//
cin>>x;
}
相關(guān)文章
C語言實現(xiàn)在數(shù)組A上有序合并數(shù)組B的方法
這篇文章主要介紹了C語言實現(xiàn)在數(shù)組A上有序合并數(shù)組B的方法,包含了數(shù)組操作的完整實現(xiàn)過程以及相應(yīng)的代碼分析與改進,具有不錯的借鑒價值,需要的朋友可以參考下2014-09-09