#include<iostream>
#include<queue>
using namespace std;
typedef struct node
{
int x;
int y;
node(int xx, int yy){
x = xx;
y = yy;
}
}ha;//加上typedef后是類型,不是變量
struct no{
int x;
int y;
}thisisvariable; //不加是變量
int main(){
ha a=node(1,2);
cout<<a.x;
ha.x=1;//這個報錯了
thisisvariable.y=3;
// cout<<ha.x;
cout<<thisisvariable.y;
return 0;
}

typedef 的報錯了,而不加typedef的沒有報錯,雖然也能輸入.然后又里面的變量,但是是有錯的


注釋掉node函數之后是可以只定義不賦值的

加上就不能只定義必須要賦值

