The info that follows is from my experience of C#, a true 3rd gen language based upon C++.
Without seeing you code I can't see what's supposed to be happening.
I tend to try not to use != null, it's not recommendend considering things like IsNull are more efficent. Look around and you'll find the proper / recommended validation values.
When dealing with characters I tend to use != EOF, as the end should be where nulls exsist.