请问,c语言中如何对结构体中某一特定成员赋值

[复制链接]
查看11 | 回复1 | 2017-9-20 18:06:50 | 显示全部楼层 |阅读模式
struct stu {char name[11];int age;double socre[3];} stud , *pst=&stud;普通结构体方式:stud.age=10;stud.score[0]=100; stud.score[1]=99;stud.score[2]=97;strcpy( stud.name , "zhang" );指针方式:pst->age=10;pst->score[0]=100; pst->score[1]=99;pst->score[2]=97;strcpy( pst->name , "zhang" );...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行