read apart of a file

hi,another problem :I want to read apart of a file which contains some chart az maze game befor them I say their name and their length and width like this
sara
3
6
._._._._._._.
| . . . . . |
. . ._. ._. .
|1|1|1|1|1|1|
. . . ._. . .
| . . . . . |
._. . . . ._.
*
door
5
6
._._._._._._.
| | | | | | |
. . ._. ._. .
| . . . . . |
. . . ._. . .
| | | | | | |
._. . . . ._.
|@.@.@.@.@.@|
. . ._._. . .
|1.1.1.1.1.1|
. ._._._. . .
*
setareh
4
5
._._._._.
|1|1|1|1|
. . ._. .
| . . . |
._. . . .
|@.@.@.@|
. ._. . .
|1|1|1|1|
._. . . .
|@.@.@.@|
. ._. . .
*
now I will give a string from player which means he wants to play the maze door.with all of this information how can I do that?
I tried it befor with this but I resived a massage that I didnt understand what was the meaning!
it runs but when I give it the name it says problem whit range?
help me please!
thanks.

cout<<"please enter the name of maze you want to play:"<<endl;
cin>>dh;
ifstream out("now.txt");
if(out.is_open())
{
while(!out.eof())
{
getline(out,dk);
if(dh==dk)
break;
}
getline(out,dm);
n=atoi(dm.c_str());
getline(out,dm);
m=atoi(dm.c_str());
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
getline(out,dm);
mar[i][j]=dm[j];
}
}
}
out.close();
Topic archived. No new replies allowed.