I was following some tutorials and i noticed that they use cin.ignore(255, '\n'); a lot. I understand that this forces the program to wait for user input before exiting the program, but what are the 255 and '\n' statements for?
255 equals how many characters are accepted in the buffer before program ends. The '\n' is delimeter that need to be found from stream before program ends.
Even 1 of those two 2 conditions need to be met to program continue. Check out following code. Program ends either:
a) 20 characters are given or
b) there is a spacebar writed