Re: function lookup


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

Posted by Lil' Viv on July 31, 2001 at 06:57:49:

In Reply to: function lookup posted by question on July 30, 2001 at 17:08:01:

: for the map function lookup which returns dataType given a key, what should we return if the key is not found? do we return a preassigned dataType which corresponds to a notFound? (i hope that last sentence makes sense) any help is appreciated, thanks.

Actually, I think we can count on the fact that he won't try to access data for a key that is non-existant. I think I heard, by word of mouth, we can count on that certainty.

But, if you are trying to get rid of your -Wall errors so that you don't get a non-compile on his script . . . I came up with kind of a ghetto solution. I just returned the root's data . . . 'cause it will never get to that case, so you will never reach a case that will 'cause it to seg. fault or return anything bad or 'cause any trouble. I just commented it accordingly, and it worked great.



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 ]