I am creating a linked list of int values. I cannot figure out why the function below doesn't find values that are in the list.
1 2 3 4 5 6 7 8 9 10 11 12
//at function returns the index of a value
//that the programmer passes to the funtion.
int iVec::at(int n){
Node *current=m;//current=first node in list.
for(int count = 0; count<size();count++){
if(n==current->data)
return count;
else
current=current->next;
}
return NULL;
}