If I use one or the other (std::cin.ignore() or std::cin.get()) then the program won't stay open. Does it really have to be a combination of the two?Code:#include <iostream>
#include <string>
int main()
{
std::cout << "Please enter your first name: ";
std::string yoname;
std::cin >> yoname;
std::cout << "Hello, "<< yoname << "!" << std::endl;
std::cin.ignore();
std::cin.get();
return 0;
}
I'm using Code::Blocks 10.05 on Win7 64.