std::ifstream file( "test.txt" ); if ( file.is_open() ) { double ff( 0.0 ); file >> ff; std::cout << ff << std::endl; }