2.2.7.5.9 omap::Set
Contents
Description
Set value by key
Syntax
BOOL Set( _TemplType key, _TemplType2 val )
Parameters
- key
- [input] key to set into the map
- val
- [input] value to set into the map
Return
Returns TRUE if key was newly inserted; FALSE if it was updated or the key/val is invalid.
Examples
EX1
void map_Set_ex() { omap<int, string> m1; m1.Set(100, "Hello"); m1.Set(200, "World"); string str; if (m1.Get(200, str)) printf("Found value at 200: %s\r\n", str); }