can someone tell me the difference betweenandCode:std::cin.ignore()I was reading a book and it told me to inputCode:std::cin.rdbuf()->in_avail()+1I figured out that puttingCode:std::cin.rdbuf()->in_avail()+1would produce the same result, by letting the program to wait for user to press enter before ending the program.Code:cin.ignore()
Also, can someone tell me how doeswork?Code:std::cin.rdbuf()->in_avail()+1
Thanks in advance ^^ Merry Chrismas~