i have a project in c++,
i am a beginner of c++.
i have to make a student management system , which basic information about name,address,gpa,major,years etc.
i try to make this code..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <iostream>
#include <iomanip>
using namespace std;
struct StudentData{
char name[100];
int number;
char major[100];
float gpa;
char addres[100];
}data;
int main(int argc, char** argv) {
cout<<"Enter name "<<endl;
cin>>StudentData.name;
cout<<"Enter number"<<endl;
cin>>StudentData.number;
cout<<"Enter major"<<endl;
cin>>StudentData.major;
cout<<"Enter Gpa"<<endl;
cin>>StudentData.gpa;
cout<<"Enter Addres"<<endl;
cin>>StudentData.address;
return 0;
}
|
what makes me confused is how can i make more record of a student??
since from cin i straighly defined StudentData.element
i want that when user type his name, it is automatically generate new object name.
e.g if i type john, all the input belongs to john. and when i type David,,all the input belongs to david.
please give me an enlighment or giving an advice what should i do..
i am very very newbie about this..
or if u have a step-by-step completly tutorial in data structure..please inform me..
Thanks in advance