Is there a way to pause the execution of a c loop? For example, something similar to the raw_input
in python. Basically, I'd like to step through a while
loop and check the variables as they change through each iteration of the loop:
while ((c=getchar()) != EOF) {
// in_string
if (c == '"' && !in_single_line_comment && !in_multi_line_comment && !has_preceding_backslash)
in_string = !in_string;
// has_preceding_backslash
if (c == '\\' && !in_string && !in_single_line_comment && !in_multi_line_comment)
has_preceding_backslash = !has_preceding_backslash;
// this line here, to 'pause' the program until further user input.
raw_input("Character: %c | InString: %d | HasSlash: %d", c, in_string, has_preceding_backslash)
}
Is there a way to do something like this?