Line 25: pointer is an uninitialized pointer. It contains garbage.
Line 29: You're trying to index an uninitialized pointer. Pretty much guaranteed to crash your program.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.