I need to reed a csv file in C. I made a struct like this:
typedef struct Node{
void** elem;
List* next;
}List;
If I dont'know what's in csv file, how can I read the elements? They can be different in the same record. A sample of a record is this: 12,ciao,45,2.4 Where i have a different type in the same record. I saw fget function yet, but it return a char* or char... I would like something more generic because I don't know what there's in the record. I will use this struct with sorting algorithm. In sorting algorithm i have a compare function like this
typedef int (*CompareFunction)(void*, void*);`
so if i can read void* on csv file and than put the element on the struct this wuold make easy the compare function.