In the lecture notes for my class, there is a function
Obj3D * findObject (int objID) {
Obj3D *pObj = ...
if (pObj == 0) {
throw BadObjectID (objID);
return pObj;
Why is it that the function returns a pointer to an object, but the return type of the function is an object?
The return type is
Obj3D *, which is a pointer.