Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

📚 The CoCalc Library - books, templates and other resources

Views: 96112
License: OTHER
1
/* Example code for Think OS.
2
3
Copyright 2014 Allen Downey
4
License: GNU GPLv3
5
6
*/
7
8
#include <stdio.h>
9
int main()
10
{
11
FILE *fp = fopen("/home/downey/file.txt", "w");
12
fputc('b', fp);
13
fclose(fp);
14
15
fopen("/home/downey/file.txt", "r");
16
char c = fgetc(fp);
17
printf("%c\n", c);
18
}
19
20