Member Avatar


I created a map<string, void*>.
The void* used to store an Object from a class called Window.

I can cout a string with the following:

it = windowMap.find(title);
	if( it != windowMap.end() ) 
		cout << "Value is: " << it->first << '\n';
	} else {
		cout << "Key nog found" << '\n';

So i can cout the string, but what i want to do is use the void*.
I figured that i have to use it->second, but i use functions of the class window.


Will of course not work.
How do I do that then?

try it as follows

Window *w=(Window *)it->second;
/*or (Window *)(it->second)      if the former gives error*/
Member Avatar


Thanks, works like a charm!