randomwangran / OOP

3 stars 0 forks source link

I/O issue #5

Open randomwangran opened 6 years ago

randomwangran commented 6 years ago

https://github.com/randomwangran/cpp/blob/d15efa12ec8465221a5ec91210926fc6f9c86101/learnCpp/Chapter9/9.x/9.x.4.d.cpp#L82-L93

This is part is actually very simple to solve:

double userInput;
in>> userInput;

point = FixedPoint2(userInput);
return in;

The problem is the code at the end of the main function:

std::cout << "Press enter to exit" << std::endl;
std::cin.get();

This causes the problem.

You could use:

system("pause");