Separated I/O operations into itemio.c

Signed-off-by: Cestmir Houska <czestmyr@gmail.com>
This commit is contained in:
Cestmir Houska 2011-04-22 02:38:57 +02:00
parent 842a6eb13f
commit bf838ea046
4 changed files with 43 additions and 19 deletions

15
itemio.c Normal file
View file

@ -0,0 +1,15 @@
#include <stdio.h>
#include "itemio.h"
struct item items[ITEM_MAXNUM];
void fill_items()
{
char buf[128];
FILE *f = fopen("items.txt", "r");
while (fgets(buf, 128, f)) {
printf("%s\n", buf);
}
fclose(f);
}