📝 Added sandbox (code sketchbook)

This commit is contained in:
z3rOR0ne 2023-04-22 00:41:54 -07:00
parent b475595f7f
commit b5daf18b1a
142 changed files with 100702 additions and 0 deletions

24
sandbox/open2.c Normal file
View file

@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE * fptr;
char c;
// Open file
fptr = fopen("file.txt", "r");
if (fptr == NULL) {
printf("Cannot open file \n");
exit(0);
}
// Read contents form file
c = fgetc(fptr);
while (c != EOF) {
printf("%c", c);
c = fgetc(fptr);
}
fclose(fptr);
return 0;
}