In my program which I'm writing as assignment for my HND is giving me a an error when I enter data in to a string value. Below is my struct Array which I'm storing my data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
struct stdDetails {
int stdNum; //Student Registration Number
char fName[25]; // Student First Name
char lName[25]; // Student Last Name
string resAdd; //Resident Address
char dBirth[10]; // Student Date Of Birth
int stdAge; // Student Age
string nicNum; // Sudent National ID number
int conNum; // Student Contact Number
char dateEnroll[10]; // Student Enrollment date
char corsSelect[25]; // Course Selected
char payMethod; // Fee payment method
double amtPaid; // Amount Student Paid for the course
char bksIssue[25]; //Issued Books
};
In the above struct I've 2 strings my problem is when I enter data when program is running it gives a error and closes I can't read the error.
Below where I enter data.
1 2 3 4 5 6
cout<<"Enter Student Resident Address : ";
//getline(cin,stdDetailsStructs_1.resAdd);
cin>>stdDetailsStructs_1.resAdd;
cout<<"Enter Student NIC number : ";
cin>>stdDetailsStructs_1.nicNum;
Please help me to get this code right and to accept data in to the array