int main (void) { while(1) { printf("输出:\n"); ............. } printf("结束死循环.\n"); }
#include <stdio.h> int main(int argc, char* argv[]) { char buffer[256]; fread(&buffer, sizeof(char), 1, stdin); while(1) { fflush(stdin); fread(&buffer, sizeof(char), 1, stdin); if(buffer[0]=='#') break; } printf("成功的退出死循环\n"); return 0; }