This throws my program into an infinite loop.

Code:
ofstream out;
string fName;

out.close( );

while( !out ) {

	cout<<"Enter file name: ";
	cin>>fName;
	out.open( fName.c_str( ), ios::out | ios::binary );		

}