c 代码初始编程
#include <stdio.h>
#include <string.h>
int main()
{
printf("app start\n");
char buffer[1024];
char buf[1024];
int aa = 0;
while (1)
{
memset(buffer, 0x00, sizeof(buffer));
memset(buf, 0x00, sizeof(buf));
printf("plese enter:");
//char * buf_t = gets_s(buffer, sizeof(buffer));
aa = scanf_s("%s", buffer, sizeof(buffer));
if(buffer[0] == 'q' && buffer[1] == '\0')
{
break;
}
else if(aa != EOF)
{
printf("print out1:%s\n", buffer);
//printf("print out2:%s\n", buf_t);
printf("print out3:scanf rerurn = %d, EOF=%d\n", aa, EOF);
}
else
{
printf("print out4:scanf rerurn = %d, EOF=%d\n", aa, EOF);
break;
}
}
printf("app quit %s\n", buffer);
return 0;
}