added a funny, a test file, and the program
This commit is contained in:
commit
ed495aa83b
35
george_interpreter.c
Normal file
35
george_interpreter.c
Normal file
@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
char s_toin[260];
|
||||
char toin[260];
|
||||
FILE *filein;
|
||||
int unin[1024];
|
||||
int in[1024];
|
||||
|
||||
void openfile() {
|
||||
printf("file to open...\n"); //open the file
|
||||
scanf("%260s", s_toin);
|
||||
printf("opening %s...\n",&toin);
|
||||
snprintf(toin, sizeof(toin), "%s", s_toin); //put filename in string that fopen likes
|
||||
if (access(toin, F_OK) == 0) { //does file exsist?
|
||||
filein = fopen(toin, "r"); //file exsists, open it
|
||||
} else {
|
||||
printf("error opening %s, press any key to exit...", &toin); //file doesnt exsist, exit
|
||||
getch();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fprintf(filein,"%s",*unin);
|
||||
printf("fprintf\n");//debug
|
||||
for (int j = 0; j < 1024; j++) {
|
||||
printf()//maybe just printf a string
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
openfile();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
BIN
george_interpreter.exe
Normal file
BIN
george_interpreter.exe
Normal file
Binary file not shown.
BIN
george_interpreter.o
Normal file
BIN
george_interpreter.o
Normal file
Binary file not shown.
3
test.george
Normal file
3
test.george
Normal file
@ -0,0 +1,3 @@
|
||||
test
|
||||
balls
|
||||
george
|
||||
Loading…
Reference in New Issue
Block a user