【娱乐精神】请在两分钟之内发现此程序BUG!!!
反正我的内核是崩溃了,还好有保护机制:lol:#include <stdio.h>
char *gets(char *s) {
int c;
char *dest=s;
int gochar=0;
while((c=getchar())!='\n' && c !=EOF) {
*dest++=c;
gochar=1;
}
*dest++='\0';
if(c==EOF && !getchar)
return NULL;
return s;
}
void echo() {
char buf;
gets(buf);
puts(buf);
}
//int main () {
// echo();
// return 0;
//}
[\b]
无聊,用scanf("%10s"); 这样不就崩溃不了了
页:
[1]