forked from brmlab/brmbar-github
Separated I/O operations into itemio.c
Signed-off-by: Cestmir Houska <czestmyr@gmail.com>
This commit is contained in:
parent
842a6eb13f
commit
bf838ea046
4 changed files with 43 additions and 19 deletions
18
brmbar.c
18
brmbar.c
|
@ -1,21 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include "defines.h"
|
||||
|
||||
struct item {
|
||||
char ean[EAN_MAXLEN];
|
||||
char name[NAME_MAXLEN];
|
||||
int price;
|
||||
} 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);
|
||||
}
|
||||
#include "itemio.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue