i create the read(...) function for read to variables.
but i need too the read()(without arguments) for press enter before continue\exit.
void read()
{
//wait if the enter key is pressed:
cin.ignore();
cin.get();
}
template<typename first_t, typename... rest_t>
void read(first_t &first, rest_t... rest)
{
std::cin >> first;
read(rest...); //function is recursive
//when the parameter pack becomes empty
//read(); will be called with no parameters
//which is why we declare it above
}
void read(string ¶meter)
{
std::getline (std::cin,parameter);
}
void read(char *parameter)
{
cin.getline (parameter, 256);
}
read();
the problem is that i need press, 2 times, the enter for exit...
why these happens?