473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Geeting hash_map values back

Hi All,

I am c++ beginner..

I have thread create function like this
pthread_create(&ThreadA,NULL,threadWork::requestTh read,(void
*)&ResultSet); // <--- ResultSet is hasp_map with around 10 key-values
in it.
in threadWork.cc member function is defined
void * threadWork::requestThread(void *ResultSet)
{
cout << typeid(ResultSet).name() << ResultSet<<endl; // <<------ its
printing void * which is correct, how can i get my hash_map and its
values back ?
}

Please guide.

Regards,
-MA
Jan 21 '08 #1
1 1536
On 2008-01-21 15:07, C C++ C++ wrote:
Hi All,

I am c++ beginner..

I have thread create function like this
pthread_create(&ThreadA,NULL,threadWork::requestTh read,(void
*)&ResultSet); // <--- ResultSet is hasp_map with around 10 key-values
in it.
in threadWork.cc member function is defined
void * threadWork::requestThread(void *ResultSet)
{
cout << typeid(ResultSet).name() << ResultSet<<endl; // <<------ its
printing void * which is correct, how can i get my hash_map and its
values back ?
}
You iterate over all the values in the hash-map and print them. Look at
the begin() and end() functions and read up on iterators.

--
Erik Wikström
Jan 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sabrina | last post by:
Can someone help? I have been trying to get the hash_map in C++ for .NET to work with strings and const char*. I am using the const char* as the key and a pointer to another class as the data...
5
by: Charles Herman | last post by:
I have the folowing program: #include <iostream> #include <ext/hash_map> using namespace std; using namespace __gnu_cxx; typedef hash_map<char*, long, hash<char*> > char_hash_t;
3
by: Murali | last post by:
I have a requirement where I have to use two unsigned ints as a key in a STL hash map. A couple of ways to do this is 1. create a struct with two unsigned ints and use that as key (write my own...
4
by: Christian Meier | last post by:
Hello, Yes, I know that hash maps aren't in the standard. But I couldn't find any better newsgroup for this post. (or is there an SGI library newsgroup?) I am currently testing the hash_map...
5
by: peter_k | last post by:
Hi I've defined hash_map in my code using this: ------------------------------------------- #include <string> #include <hash_map.h> & namespace __gnu_cxx {
1
by: anjangoswami06 | last post by:
Hi, I am interested to know how it is possible to update the data type with "insert" with stl hash_map. Suppose we have, hash_map<const char *, MyDataType, hash_compare<const char*,...
11
by: aaragon | last post by:
Hello everyone, I have a VERY BIG set of double values that I want to map to intervals so I thought a clever way to do this was using a hash table. Let's say that I want to map all double values...
1
by: mono12 | last post by:
Hi! I have written code using STL hash_map in c++ and am running into memory issues. I have two kinds of hash_maps: A <int,int> which stores ~5million key-value pairs, and needs to be accessed...
4
by: James Kanze | last post by:
On Jul 16, 10:53 pm, Mirco Wahab <wa...@chemie.uni-halle.dewrote: It depends. You might like to have a look at my "Hashing.hh" header (in the code at kanze.james.neuf.fr/code-en.html---the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.