apps/hello: Demo fgets
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-03-23 21:35:21 +01:00
parent 0e9890901f
commit 00672c4b22
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -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);
}