hi again,im having some problem while coding with hash_map
my coding was like this:
#include<iostream>
#include<hash_map>
using namespace std;
int main()
{
typedef pair<int,int>make_pair;
hash_map<int,int>::iterator hmp0_iter;
hash_map<int,int>hmp0;
hmp0.insert(make_pair(1,78));
hmp0.insert(make_pair(3,34));
for(hmp0_iter=hmp0.begin();hmp0_iter!=hmp0.end();hmp0_iter++)
{
cout<<(*hmp0_iter).second<<' ';
}
cout<<endl;
return(0);
}
error was like this:
hashdemo.cpp:2:19: hash_map: No such file or directory
hashdemo.cpp: In function `int main()':
hashdemo.cpp:8: error: `hash_map' was not declared in this scope
hashdemo.cpp:8: error: expected primary-expression before "int"
hashdemo.cpp:8: error: expected `;' before "int"
hashdemo.cpp:10: error: expected primary-expression before "int"
hashdemo.cpp:10: error: expected `;' before "int"
hashdemo.cpp:12: error: `hmp0' was not declared in this scope
hashdemo.cpp:15: error: `hmp0_iter' was not declared in this scope
but when i replaced #include<hash_map>with #include<hash_map.h>the program ran and printed the output but it did showed some warnings saying im using deprecated header.
im workin in linux using gcc(version3.4.6)so does it support hashmap??