语法: (结构类型){初始化列表};
用法:可为一个结构变量提供多个可供替换的值;
1 struct book{ 2 char title[20]; 3 char author[20]; 4 float value; 5 }; 6 7 int main() 8 { 9 struct book readfirst; 10 int score; 11 scanf("%d",score); 12 if(score>=84) 13 { 14 readfirst=(struct book){"crime and punishment","Fyoder 15 Dostoyevsky",11.25}; 16 } 17 else 18 readfirst=(struct book){"crime and punishment","Fyoder 19 Dostoyevsky",5.99};
标签:struct,int,C99,复合,char,book,readfirst,score,字面 From: https://www.cnblogs.com/mcb97605/p/17453535.html