I want to be able to do something like pause the program after displaying 10 characters of ASCII values and say Continue or something to resume. I use Visual Studio 2017 if that of any use.
Asked
Active
Viewed 249 times
-7
-
2C'mon, read the documentation. – alk Sep 04 '17 at 14:41
-
4and why are you shouting? – Sourav Ghosh Sep 04 '17 at 14:42
-
1@SouravGhosh: The OP had been quieted down ... ;-) – alk Sep 04 '17 at 15:01
1 Answers
1
char str[] = "This is my string of text that will be outputted. After every"
" ten characters, this will be interrupted.\n";
size_t i;
for (i = 0; str[i] != '\0'; ++i) {
putchar(str[i]);
if (i % 10 == 0) {
printf("Press any key to continue . . .\n");
getchar();
}
}

lost_in_the_source
- 10,998
- 9
- 46
- 75
-
1
-
-
3
-
-
-
-
-
1Thought you were joking ..., weren't you? ;-) I didn't downvoted this, BTW. – alk Sep 04 '17 at 15:05