Help!! [void** and vectors]

Started by
3 comments, last by justin12343 13 years, 8 months ago
I'm trying to make a function thats casts a array into void** returns it, but I don't know if I'm doing this correctly.

class mapData{public:	mapData( vector<LPDIRECT3DTEXTURE9> tl): texture_list(tl)	{		mNumTiles=0;	}	~mapData(){};	int tw, th;	int mNumTiles;	vector<tile> tile_list;	vector<LPDIRECT3DTEXTURE9> texture_list;};LPVOID &getMapData()	{		static void *data;		data =(LPVOID)&md;  //md is the array		return data; 	}


When I cast it back to mapData ( (mapData**)&GetMapData()), the debuggers shows that it doesn't have the original values.

[Edited by - ApochPiQ on August 25, 2010 5:10:22 AM]
Advertisement
Well I can only guess since there is no declaration of md but I think,
that you already return a void** so why are you applying the &-operator?
It should work when you do the cast like this: ( (mapData**)GetMapData())
Hold up... what are you using a void** for? Chances are something is amiss...


Also, please choose more appropriate thread titles in the future. "Help!!" is kind of annoying [wink]

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I do not see any variable or value anywhere in your posted code that is of type void**.

And why don't you show us the definition of 'md' instead of just commenting on it?
Never mind, I fixed it. Thanks for caring to post.

This topic is closed to new replies.

Advertisement