19 lines
384 B
C
19 lines
384 B
C
#include <stdio.h>
|
|
int main() {
|
|
FILE *fp;
|
|
fp = fopen("iotext.txt", "w");
|
|
if (fp == NULL) {
|
|
printf("Error opening file\n");
|
|
return 1;
|
|
}
|
|
fprintf(fp, "CS2263!\n");
|
|
fclose(fp);
|
|
fp = fopen("iotext.txt", "r");
|
|
char c;
|
|
do {
|
|
c = getc(fp);
|
|
putchar(c);
|
|
} while (c != EOF);
|
|
fclose(fp);
|
|
return 0;
|
|
} |