Closing program

This is a discussion on Closing program within the C++ Programming forums, part of the General Programming Boards category; Code:
char name[50];
char exit;
cout << "Please enter you name for the High Scores list : ";
cin.getline(name, 50);
...

1) The whole program is very large so I just gave the function.
2) Not sure, but why should it close? Is it the WriteFileScore.close() function?
3) The block of code I posted in my first post just closed without making the file (in case you were wondering). Code block A. works fine as its own program, but it wont work with the big program I am doing. Code block B. is the complete function that I tried to use in my program. Block B. is just code block A., but instead of using the int "score", it uses "player.score". Code block B. gives the same problem as the first block of code i posted.
Thanks

then call player.getScore() if you want to find out the score... you should never be able to directly access data members... if you want to be able to modify the score, create a method called setScore(int) in the public section and have that modify the private member...

What scope does player have? Unless player has global scope B code won't work. If score is a private data member of player then even if player has global scope your code won't work. What class is player an instance of? Post code please.