- กุมภาพันธ์ 12, 2014
- โพสโดย: ทีมงาน Forex Wiki
- หมวดหมู่: ไม่มีหมวดหมู่
ไม่มีความคิดเห็น
1668
1535
ชื่อ: |
|
||
ผู้เขียน: | 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("ต่ำ",0); h.hPutInt("สูง",1); // Get values int high = h.gGetInt("สูง"); // Loop HashLoop *l ; สำหรับ( l = new HashLoop(ชม.) ; l.hasNext() ; l.next()) { string key = l.key(); int j = l.valInt(); Print(key," = ",เจ); } delete l; delete h; คำแนะนำ:
|