so i have this simple program where i have to load values into arrays in another function, have csv file with some data of people randomly generated, separated by ; and need to load into 3 separate arrays
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//not all necessary just the usual i put at the beggining
int main()
{
char name[100];
char surname[100];
int birth[100];
load_values(name,surname,birth);
}
int load_values(name,surname,birth)
FILE *data;
data = fopen("list_of_values.csv","r");
char letter;
while(letter = getc(data)) != EOF){ //using this to go trough the file, yes it is quite bad also need help :D
fgets(data,"%s","%s","d",&name,&surname,&birth) ///reads the file by lines and puts walues into arrays?
return (name,surname,birth);
}
list_of_values.csv look like this
Tom Brombadil;1997
Joh-Bob Larson;1999
Evan Thompson;1899
//probably the ; will be a problem too :/
expecter result is for the arrays to hold values like:
name[Tom,Joh-Bob,Evan]
surname[Brombadil,Larson,Thompson]
birth[1997,1999,1899]