Well is ptr initialized anywhere? You didn't post the calling code. I also think you're getting confused with pointer notation.
This means nothing unless ptr is a pointer to a pointer, which it isn't.
Are you checking to see if the pointer is not null? Get rid of the asterisk. Right now you're checking to see if the value pointed at by ptr is not 0.
but i have no other choices to finds the length of a linked list
recursively other than this cuz we wont be able to use more variables unless we need it.
*ptr is already initialized in the class itself
Oh, you're missing the starting bracket for your function.
And what I said about pointer notation still stands.
even if i took out the pointer and change the variable i get the same error> I hate errors that i dont understand i wont be able to fix it!!!!!!
I told you what the problem was, you're missing your opening bracket for your function.
its not about the bracket cuz still m having the same error