Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DNA* DNAList::find(int id) {
- /*if (head->next != nullptr) {
- cur = head->next;
- }
- else {
- return nullptr;
- }*/
- bool found = false;
- cur = head;
- while (!found && cur->next != nullptr) {
- if (cur->dna->dnaOne.id == id ) {
- found = true;
- }
- else {
- cur = cur->next;
- }
- }
- if (found) {
- return cur->dna;
- }
- else {
- return nullptr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement