我希望能够在显示10个字符的ASCII值后暂停程序并说“继续”或“继续”。 如果有任何用途,我使用Visual Studio 2017。
答案 0 :(得分: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();
}
}