cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Comparing integer and pointer
Comparing integer and pointer
Apr 20, 2017 at 5:17pm UTC
rcat164
(1)
I am writing code to compare a zipcode integer input (int z) and the zipcode of the input ZNode object *n. When comparing them I keep getting error of comparison between z and ZNode n. How can i compare an integer and a pointer?
Here is my code:
ZNode AVLTree::*findZip(int z, ZNode *n){
if(z==n->zip || n==NULL){
return(n);
}
else if(z < n->zip){
findZip(z, n->left);
}
else if(z > n->zip){
findZip(z, n->right);
}
}
Apr 20, 2017 at 9:56pm UTC
jonnin
(11368)
need to see the variable in the class also. Is it a pointer, do you need to double dereference it?
Topic archived. No new replies allowed.