using new on an array of class pointers?

Hello all. i am new here but you all seem like a good community so i was wondering if i could please have some help.

I have some code here however i cannot get it to work right...
i have a class called "Map" and on its constructor i have made it take 2 integers "(int iX, int iY)" these tell the class how big (in predefined tiles) a map is. now to contain all of my maps i have "Map *game_Maps[10];" the problem i am having is starting a map with this. I would assume using "game_Maps[0] = new map(30, 30);" would work however it does not and i get a error C2440 on VC2008e. So how would i start using one of these maps? do i even need to define new? can i just start using the methods of the "Map" class on any element in this array.

I am aware this may well be really simple but please and thank you in advance.
Nekroze
game_Maps[0] = new map(30, 30);

Did you just copy-paste this line? Was class name "map" or "Map"?
sorry you are correct it is Map however the fact remains that it doesnt work. im back to the old error i had before i mispelled that (sorry sick atm) using the stepper i find that once it gets to that line eraggo, it then switches to disassembly and ends up throwing:

"Unhandled exception at 0x00f2af22 in maptest.exe: 0xC0000005: Access violation reading location 0xabababb3."
Post some code so we can see what you are really trying to do.
Topic archived. No new replies allowed.