@Schizorb
510 / 462 / 16
Регистрация: 07.04.2012
Сообщений: 869
|
09.01.2013, 08:28
|
|

Сообщение от samarcs
изначально все и было в int
Так было?
C++ | 1
2
3
4
5
6
7
| struct Info
{
char shifr[30];
int costud;
int otstud;
int nostud;
}; |
|
Если да, то функция нормально компилируется:
C++ | 1
2
3
4
5
6
7
8
9
10
| void GetListFromInit(Info* List, int n)
{
for(int i=0;i<n;i++)
{
strcpy(List[i].shifr, InitList[i].shifr);
List[i].costud = InitList[i].costud;
List[i].otstud = InitList[i].otstud;
List[i].nostud = InitList[i].nostud;
}
} |
|
Массив только инициализируете значениями не тех типов:
C++ | 1
2
3
| Info InitList[5] = {{"100400",30,15,15},{"200400",40,20,20},
{"300400",20,10,10},{"400400",30,15,15},
{"500400",10,5,5}}; |
|
1
|