Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printSpecifiedElement()
- {
- int id;
- cout << "Enter ID of student to be printed: " << endl;
- cin >> id;
- if (first == 0)
- {
- cout << "No students available!" << endl;
- }
- else
- {
- temp = first;
- while (temp->next != 0 && temp->id != id)
- {
- temp = temp->next;
- }
- if (temp->id == id)
- {
- cout << "Match found!" << endl;
- cout << "Student ID = " << temp->id << endl;
- cout << "Student score = " << temp->score << endl;
- cout << "Student gender = " << temp->gender << endl;
- }
- else
- cout << "No match found!" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement