#include <iostream>
#include "Stud.h"
using namespace std;
int main()
{
short x;
cout << "Hello and Welcome to the minigame!" << endl;
cout << "Please state how many students you would wish to add to the mini-game (Your choice cannot be changed later so be careful!)" << endl << "~> ";
cin >> x;
cout << endl << endl;
// Get this fixed!!!
Stud st[x];
cout << "Now please input the information of your student('s)" << endl << endl;
for (int i = 0; i <= x; i++) {
cout << "Student Number " << i + 1 << ", What is your Name? " << endl << "~> ";
st[x].getName();
cout << endl;
}
cout << "Check!";
return 0;
}
Line 24: Stud st[x];
I want to make it so that the user can choose how many students get to participate but can't seem to understand how not to get the "expression must be a constant value error...
I've managed to temporarily fix it by changing st[x] to st[50] and st[x].getName to st[i].getName so that I can attempt other functions while I'm learning what I can do about it...