I have a function that will look something like this:
How do I get it so I can check root from the beginning of the list every time and still keep the updated count value??Code:void function(node* root, int num) { int i = 0; while(i < 10) { while(root->data != num || root != NULL) { root->next; } if(root->data == num) { root->count++; i++; } } }