apps/hello: Demo fgets
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0e9890901f
commit
00672c4b22
@ -3,4 +3,10 @@
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
printf("Hello world! argc=%d, argv[0]=%s, argv[1]=%s, argv[2]=%s\n", argc, argv[0], argv[1], argv[2]);
|
||||
|
||||
char buf[1024];
|
||||
char* rc = fgets(buf, sizeof(buf), stdin);
|
||||
if (!rc) perror("fgets");
|
||||
|
||||
fputs(buf, stdout);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user