I\'m pretty new to C++ so I tend to design with a lot of Java-isms while I\'m learning. Anyway, in Java, if I had class with a \'search\' method that would return an object
If you want a NULL
return value you need to use pointers instead of references.
References can't themselves be NULL
.
(Note to the future comment posters: Yes you can have the address of a reference be NULL if you really really try to).
See my answer here for a list of differences between references and pointers.