qt – Minigame, problem with ifstreams ans position of protagonist

I want to create a little program with Qt-Creator in which you can read external maps e.g.:
P: player_pos, #: walls

The (custom) maps shall be saved in .txt so i can read i with ifstream.
Then I put the 2 dimensional map in an std::vector.

How shall I realize the position Problem? Should I inspect every buffer(i) if it is P or
would it be better to creat a global variable which is not whipe by the RAII after the funciton call refreshes?
And when I read from an ifstream how can I distinguish whitespaces from end of lines? If I use a << ifstream it leaves out any whitespaces… (The map isn’t necessarily rectangular).