- فروری 12, 2014
- کی طرف سے پوسٹ کیا گیا: فاریکس وکی ٹیم
- قسم: غیر زمرہ بندی
نام: |
|
||
مصنف: | Andrew Lord (2014.02.11 16:34) | ||
ڈاؤن لوڈ کیا گیا۔: | 6 | ||
ڈاؤن لوڈ کریں: |
|
||
تفصیل:This is a HashMap implementation. This allows something like arrays but with string indexes. It maps strings to Objects. The Objects must be a subclass of the HashValue class provided. The Hash by default will 'adopt' the value objects. In which case it will free the memory when they are no longer in the hash. This can be disabled in the constructor. Here is an example:
Hash *h = new Hash(); // Store values h.hPutInt("low",0); h.hPutInt("high",1); // Get values int high = h.gGetInt("high"); // Loop HashLoop *l ; کے لیے( l = new HashLoop(h) ; l.hasNext() ; l.next()) { string key = l.key(); int j = l.valInt(); Print(key," = ",j); } delete l; delete h; سفارشات:
|