Besides the fact that the compile has no way to know which version of
GetCurrentSize
you intend to use at any point, because they have the same signature. Your iterative version declares the
count
from within the loop, so it's value is not necessarily carried from iteration to iteration. It fails to initialize it at all. And you never actually return the value.
More like:
int GetCurrentSize(node* cur){
int count = 0;
while(cur != NULL){
cur->next_node;
count++
}
return count;
}