Re: function lookup


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Aaron on July 30, 2001 at 19:40:21:

In Reply to: Re: function lookup posted by kristine on July 30, 2001 at 18:43:53:

: : What about just NULL? isn't that NATTA for any data type? or NOT_found would probably work too..

: i was wondering same thing. but would returning NULL work because you are suppose to be returning a datatype....

NULL won't work because it's basically defined like this in stdlib.h
#define NULL 0x0
this means that it is just setting whatever you want equal to 0. most classes will poop when you try something like variable = NULL, and the string class goes so far as to segfault. if you look at the policy for the class on the website, he states that we can assume that he will never call lookup on a non-existant key, because he always proceeds that with a call to contains.

aaron


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]