Home > Back-end >  About the object of the class array to realize
About the object of the class array to realize

Time:09-19

Int main ()
{
Int I, num;
Cout & lt; <"Please enter the class students:";
Cin & gt;> Num.

Student s (num);
for (i=0; I & lt; Num. I++)
{
Cout & lt; <"Please enter the first" & lt; S [I] s_set ();
}
for (i=0; I & lt; Num. I++)
{
Cout & lt; <"The first" & lt; S [I] s_get ();
}
return 0;
}
Write that will display in the main function num must be a definite value, is why can't I input values?

CodePudding user response:

C + + standard does not allow

CodePudding user response:

CodePudding user response:

To be dynamic, can use the vector
#include
using namespace std;
Int main ()
{
Vecotr s;
  • Related