I am working on struct array and the challenge is I have to
Display 10 records at a time. How can I have my program display
10 records at a time and continue from the last record
Displayed to output 10 more records and so on?
@dragonblaze Try just looping through the array and once it's looped 10 times, store the index of where it stopped and then just start at the index you stored for the next 10.
@germanchocolate Thanks for your reply, appreciate it. I am really new in programming, can you please share or show here a basic syntax of how I can loop struct array? Thanks in advance
int main (){
for (int n = 0; n < 25; n++){
cout << "Enter Name: ";
cin >> per[n].fname;
cout << "Enter Age: ";
cin >> per [n].age;
}
for (int n2 = 0; n2 < 100; n2++){
cout << per[n2].fname << " age is " << per [n2].age;
}
}
This is the code I am working at, I just need to display 10 records or lines per page. Need help on how to do that. Thank you very much for all the replies!