C98与C11结构体初始化(C98强转) 原创

C11构造函数列表初始化
struct node{
	int x,y,s,f;
	node(int xx,int yy,int ss,int ff){x = xx,y = yy,s = ss,f = ff;}
};

q.push(node(tx,ty,t.s+1,t.f));
C98强转
struct node{int x,y,s,f;};

Node node=(Node){1,2,3,4};

q.push((node){x,y,0,0});

posted @ 2024-04-03 22:13  俺叫西西弗斯  阅读(0)  评论(0编辑  收藏  举报  来源