Would the following make sense at all? How could I fix it?
Say I wanted to do this..
What is incorrect about this? I want to prompt the user to keep inputting values until they've done it 10 times. Store each set of 3 values in it's own separate struct element of the array.Code:... Student studentArray[10]; //declaration of Struct array struct Student studentArray[10]{ int no; char grade[3]; //struct members double average; }; int x; for(x = 0; x < 10; x++){ cin >> intInput; cin >> charInput; cin >> doubleInput; Student studentArray[x].no = input1; Student studentArray[x].grade = input2; Student studentArray[x].average = input3; intInput = 0; charInput = ""; doubleInput = 0.0; } ...



LinkBack URL
About LinkBacks




