if I leave the &dummy and second %c specifier scanf with ¬e2 gets an error later. is that because without the dummy the second scanf recieves the carriage return? I not sure why ¬e2 doesnt also need a dummy ?
if I leave the &dummy and second %c specifier scanf with ¬e2 gets an error later. is that because without the dummy the second scanf recieves the carriage return? I not sure why ¬e2 doesnt also need a dummy ?
You don't need the dummy variables if you simply add a single space before the %c, like this:
a space in scanf tells it to ignore all whitespace characters, like newline, tab, space etc.Code:scanf(" %c", ¬e1); scanf(" %c", ¬e2);
Devoted my life to programming...