c语言数组的赋值答:int a[10]={0,1,2,3,4};表示只给a[0]~a[4]5个元素赋值,而后5个元素自动赋0值。2) 只能给元素逐个赋值,不能给数组整体赋值。例如给十个元素全部赋1值,只能写为:int a[10]={1,1,1,1,1,1,1,1,1,1};而不能写为:int a[10]=1;多维数组也是一样 给数组赋值的方法除了用...
C++里面,含有数组的类对象是怎么赋值的?答:C++类的对象数组赋值问题 如下:void main(){ CStudent Cs[4]={ CStudent(1,"张三",80), CStudent(2,"李四",75), CStudent(3,"王五",95), CStudent(4,"小六",62) }; //这样就可以赋初值.也可以使用成员函数一个个设置.如下:/* Cs[0].SetID(1); Cs[0].SetName("...
C#中用数组实例化一个类,如何给数组每个成员的字段进行赋值答:student[] a= new student[10];a[0] = new student();a[0].chinese = 1;或者:student[] a= new student[10]{new student(),new student(),new student(),new student(),new student(),new student(),new student(),new student(),new student(),new student()};a[0].chinese =...