PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Getting both reached-from and nsteps from hash table
Date: Tuesday, 14 Apr 2020, 19:41:21


    > Message Posted By: Unknown
    >
    > I'm a little confused on how to get both REACHED-FROM and NSTEPS from the
    > hash table, since a DictSearch function can only return one value.

No, it can only return one value via the name of the
function.  To return multiple values you can pass a
pointer to a variable in the calling program and use
that pointer within the function to set its value.
For example, remD() returns a status via the name of
the function and the string removed via a pointer to
a char *.
=====

    > Should we be making the triples a struct of their own and just return the
    > entire triple struct from DictSearch? Or should we encapsulate
    > REACHED-FROM and NSTEPS into their own struct (separate from POSITION)?

Those are other possibilities that require more code.

--Stan-
PREV INDEX NEXT