First, please spend a bit of money on some indenting, it's cheap.
Simple solution is to allocate single record object. Input to it, then assign it to the next spot in the array.
//after line 21
record temp;
//replace line 42 & 44
cin >> temp.name;
cin >> temp.number;
//insert new data
data[count] = temp;
count++;
//or you can input directly to the array
cin >> data[count].name;
cin >> data[count].number;
count++;
Of course, you should first check count to ensure there's actually room in the array.
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228