Link to home
Start Free TrialLog in
Avatar of Buffon
BuffonFlag for Israel

asked on

standard template libraries

I need to know how with STL I can use associative arrays, please provide code examples.
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

You have to use STL map object. Have a look to a previous discussion:
https://www.experts-exchange.com/questions/20566432/Associative-array-of-string.html
Avatar of Buffon

ASKER

I saw this declaration:

typedef map<string,string> line;


as I understand it, it declares something like hashtable (value + key), so in declaration first "string" represents key or value?
>as I understand it, it declares something like hashtable (value + key), so in declaration first "string"
>represents key or value?
No, there is an non-standard hash_map<> collection class in some STL implementations.
Map usually have some internal implementation of tree (binary, balanced, etc....) but there is no a rule about this. Anyway, this is transparent to the user.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial