Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Need Hashmap in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 45444 of 48002
Post > Topic >>

Need Hashmap in C AND C++

by lbrtchx@[EMAIL PROTECTED] Apr 24, 2008 at 07:18 PM

Hi,
~
 I have found myself in need of some code resembling a Hashmap
~
 This is easily done in Java this way:
~
im****t java.util.*;

// __
public class JMith00Test{
 public static void main(String[] aArgs){
  HashMap<String, Integer> HMSI = new HashMap<String, Integer>();
  HMSI.put("one", (new Integer(1)));
  HMSI.put("zwei", (new Integer(2)));
  HMSI.put("tres", (new Integer(3)));
// __
  String aK;
  int iIxCnt = 0;
  System.out.println("// __ HMSI.size(): |" + HMSI.size() + "|");
  Iterator<String> IT = HMSI.keySet().iterator();
  while(IT.hasNext()){
   aK = IT.next();
   System.out.println("// __ |" + iIxCnt + "|" + aK + "|" +
HMSI.get(aK) + "|");
   ++iIxCnt;
  }
 }
}
~
 I was wondering if there are plain ANSI C hashmaps?

 Thansk
 lbrtchx
 




 1 Posts in Topic:
Need Hashmap in C AND C++
lbrtchx@[EMAIL PROTECTED]  2008-04-24 19:18:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 14:19:15 CDT 2008.