You're still missing to flush the standard input stream, before starting the while-loop over again. You have to insert a fflush()-function in the start of the while-loop or at the end of it. If you're looking at the last code I posted in this thread, you can see that there's two fflush()-functions, not only one.
The reason why you have to insert one, is because that after you have selected something in the menu, and again
inputs something - f.ex. CHAR => ASCII, then the stdin get new data again - and that data, we've to clear. That's by using the fflush()-function at stdin. If you read my comments in the code, you could see it too.
Code:
#include <stdio.h>
int main()
{
int i, type;
char c;
type = 0;
printf("ASCII character program\n\n");
while(type != 'q')
{
/* Here's all the other stuff ... */
/* At the end, we need to have this */
fflush(stdin);
}
return 0;
}