1 2 3 4 5 6 7 8 9

MapGetSS ( Map M, String I ) -> String


MapGetSI ( Map M, String I ) -> int


These functions use I to locate the index-value pair < I,V > in map M
and return V.


If the pair < I,V > does not exist then MapGetSS and MapGetISquietly
adds < I,"" > to M and returns the null string,


and MapGetSI and MapGetIIquietly adds < I,0 > to M and returns 0.
-----------------------------------------------------------------------------------
If the type of V is String and an int is expected then the value
atoi(V) is returned. The entry was previously created by MapSetSS,
perhaps. There are other ways of converting a string to an integer,
but assume a valid 32-bit integer will result.


If the type of V is int and a string is expected then V is converted to
a string
----------------your choice design decision--------------------
which then replaces the old value of V (which must be
properly disposed of), and V is returned.

Type

Index

Value

IMAGE imgs/lec-14.sli01.gif

"1941"


"dog"

top.c and spell.c use SI entries only, anagram.c uses SS entries

February 15 1998

Page 9

TAM C201 notes