I'm trying to make a function that returns an address to some sort of map, for the purpose of assigning to or retrieving a value from said map.
The format I'm looking to achieve is the following:
1 2
varac('A') = foo; //To assign foo to 'A' in the map
bar = varac('A'); //To assign value corresponding to 'A' to bar
The varac function needs to be in the format:
1 2 3 4 5 6 7
variant &varac(char letter)
{
if (<letter isn't found in the map>)
<add letter to the map>;
return <address location for the value in the map corresponding to letter key>;
}
I can't differ from this format at all. So can this actually be done? Thanks a lot for any help. :)