Re: How to use associative arrays in Ada 2005?



On 23 Nov 2006 11:27:31 -0800, snoopysalive wrote:

The statement "Ages.Insert("family name",Insert("name",23));" doesn't
work. So, how is it possible to do something like this in C++:
"...
map<string, map<string,int>> ages;
ages["family name"]["name"] = 23;
..."

But this does not look like a hash of hashes. Rather it is a hash of
StringxString. If so, then you could make a record type with two string
fields and build a hash over it, or alternatively, pack two strings into
one using some delimiter character. To construct such keys you could write
a helper function:

type Key_Type is new String;
function Key (First_Name, Second_Name : String) return Key_Type;
....

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: [fw-wiz] Stanford break in
    ... > number and a special character.) ... > change the hash and make it harder for brute force to check. ... a password cracker takes strings and hashes them.. ... you gotta burn MORE cycles producing hashes from each string. ...
    (Firewall-Wizards)
  • Re: Generating a unique string without normal character sets
    ... UID inviteId = new UID; ... I'd like to have a unique string consists of normal characters, ... No, Hashes are never guaranteed to be unique, but the good ones have a ... general, so I'd argue that a perfect hash is a hash, that a perfect ...
    (comp.lang.java.programmer)
  • Re: [Full-disclosure] Month of Random Hashes: DAY THREE
    ... What am I going to do with hashes? ... > that sha1 hash signature, fucking that sha256 hash signature, fucking ... >> but only one string can produce that md5 hash signature, ...
    (Full-Disclosure)
  • Re: How to write a diff in VB6 for comparing two xml files?
    ... No, the best you could do is to read both into string and use StrCompbut it's inefficient and, but using the hash ... Private Declare Function CryptAcquireContext Lib "AdvAPI32.dll" Alias _ ... Dim HashAAs Byte, HashLenA As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: something like switch in c
    ... >> straightforward string comparisions. ... > inner table size and/or add symbols to expand the hash. ... It all depends on the empirical pattern of the actual keys. ... The value of the random number generator is UNCHANGED on ...
    (comp.programming)