Thanks for this helpful tutorial!
One question: why does the main method break out of the do-while loop after its first iteration if you remove
fpurge(stdin); //fpurge can be used which will flush out buffer and takes the input
scanf("%c", &response); //in this case no need to use \n
The \n tells scanf() to read IN, and NOT save, any number of white-space, not just only ‘\n’. Reads will continue until a non-white-space is read. That non-white-space is put back into stdio for subsequent scanning.
so if you remove \n then scan is reading some unknown character(may be white space so exiting) but when \n is used the input you are giving will be in the new line in which your input will be the first character in that line.
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]