Commit d84c90a9 by trkall

teine prax, parandus

parent 8461d296
No preview for this file type
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
//#include <stdlib.h>
//Andmefaili lugemis yl //Andmefaili lugemis yl
char *CHKCODE = "01"; char *CHKCODE = "01";
...@@ -21,7 +20,6 @@ int t66tlus(Inimesed *Isik, Inimesed *Uus); ...@@ -21,7 +20,6 @@ int t66tlus(Inimesed *Isik, Inimesed *Uus);
int main(void) int main(void)
{ {
printf("TEST");
Inimesed *Isik; Inimesed *Isik;
Inimesed *Uus; Inimesed *Uus;
FILE *andmed; FILE *andmed;
...@@ -30,7 +28,7 @@ int main(void) ...@@ -30,7 +28,7 @@ int main(void)
if (chkFile(andmed) == 0) if (chkFile(andmed) == 0)
{ {
printf("ERROR"); printf("Faili ei leitud!");
return 0; return 0;
} }
...@@ -54,10 +52,8 @@ int chkFile(FILE *andmed) ...@@ -54,10 +52,8 @@ int chkFile(FILE *andmed)
void sisse(FILE *andmed, Inimesed *Isik) void sisse(FILE *andmed, Inimesed *Isik)
{ {
int i = 0; int i = 0;
//Isik = (Inimesed*)malloc(sizeof(Inimesed));
while(!feof(andmed)) while(!feof(andmed))
{ {
//Isik = (Inimesed*)realloc(Isik, 500);
fscanf(andmed, "%s %lf %s\n\n", (Isik+i)->nimi, &(Isik+i)->money, (Isik+i)->code);/// VIGA fscanf(andmed, "%s %lf %s\n\n", (Isik+i)->nimi, &(Isik+i)->money, (Isik+i)->code);/// VIGA
i++; i++;
} }
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment