|
|
Process student data
Initialise Data
|
Struct Student{
}; const int MAX_ENTRIES //function prototypes struct SData[MAX_ENTRIES]
|
Initialise Data
Initialise all struct array elements |
s.FirstName = " ". |
Input Data
Prompt user for data Read data into struct Read struct into array element |
Cout<<"Enter Firstname";
Getline(cin, s.FirstName); ReadData(Sdata[numEntries]) numEntries++; |
Find Data
Accept string Search-for-name |
string name;
getline(cin,name) |
Search-for-name
Compare FirstName in each array position with string. Output name if found |
bool found = false; int i;
if(name == Sdata[i].FirstName{
|
Output Data
Print all Records |
|
Print all Records
For each array element Print a record |
for(i=0;i<numEntries;i++)
PrintData(Sdata[i]); |
Print a Record | Cout<<"name: "<<s.FirstName
Cout<<"name: "<<s.LastName |