tk5-c90-projects/src/TXTWKR01.c

22 lines
393 B
C
Raw Normal View History

#include <stdio.h>
int main()
{
2026-02-08 15:43:02 +00:00
FILE *fp;
char buf[256];
2026-02-08 15:43:02 +00:00
fp = fopen("dd:TESTDD", "r");
if (fp == NULL) {
printf((char *)"fopen read failed\n");
return 1;
}
2026-02-08 15:43:02 +00:00
printf((char *)"Existing content:\n");
while (fgets(buf, 256, fp) != NULL) {
printf((char *)"%s", buf);
}
2026-02-08 15:43:02 +00:00
fclose(fp);
2026-02-08 15:43:02 +00:00
printf((char *)"Read complete.\n");
return 0;
2026-02-08 15:43:02 +00:00
}