Don't use relational operators on pointers. Use !=.

But that's probably not the problem. Code?

By the way, in Java, all variables of object type are pointers (Java calls them references). In C++, variables are objects unless you explicitly make them pointers or references.