I want to print dynamic array index size.
'InputeData' function makes three dynamic arrays. I want to get the array index size in the main function.
for example, int arr[10]; ->> the index size is 10 I want another way to get the size, not making a new array to memorize it.
Here is the code that I have
struct Subject {
char SubName[30];
char Grade[10];
float GPA;
};
struct Student {
char StdName[30];
Subject* Sub;
};
int SubNum;
Student Std[3];
Subject* Sub;
void InputData(Student* stu)
{
for(int i=0; i<3;i++{
cin >> SubNum;
stu[i].Sub = new Subject[SubNum];
}
}
int main()
{
InputData(Std);
cout<< //want to print out dynamic array index size
}