带参构造函数为结构体对象数组赋值的方法
2013-06-05 21:27
393 查看
struct student { char name[10]; int sore1,sore2,sore3; student(char a[10],int d,int b,int c) { strcpy(name,a); sore1=d; sore2=b; sore3=c; } }; int main() { student stud[5]= { student("chenlan",85,78,76), student("huanghong",97,68,87), student("zhanghua",67,98,67), student("yexuan",98,87,76), student("baiwei",87,68,98) }; for (int i=0;i<5;i++) { printf("%s\t%d\t%d\t%d\t\n",stud[i].name,stud[i].sore1,stud[i].sore2,stud[i].sore3); } return 0; }
相关文章推荐
- 带参构造函数为结构体对象数组赋值的方法
- 带参构造函数为结构体对象数组赋值的方法
- vue 数组和对象不能直接赋值情况和解决方法
- vue 数组和对象不能直接赋值情况和解决方法(推荐)
- PHP实现删除多重数组对象属性并重新赋值的方法
- 数组赋值--通过构造方法灵活地实现对象参数初始化
- php删除多重数组对象属性,重新赋值的方法
- jquery遍历筛选数组的几种方法和遍历解析json对象
- 给字符数组赋值的方法
- js中数组对象去重的方法
- jq中的isArray方法分析,如何判断对象是否是数组
- android Model对象转换方法,两个实体类对象赋值简便方法
- JavaScript中数组对象的那些自带方法介绍
- javascript 数组以及对象的深拷贝(复制数组或复制对象)的方法
- byte数组到图片到硬盘上 与对象转byte数组 方法
- 给数组原型对象添加方法
- JS面向对象(2) -- this的使用,对象之间的赋值,for...in语句,delete使用,成员方法,json对象的使用,prototype的使用,原型继承与原型链
- JS中深拷贝数组、对象、对象数组方法总结
- php数组操作之键名比较与差集、交集赋值的方法
- 包含对象为Integer的List列表转为Integer数组并排序的简单方法