I'm a new C programmer. I have got the situation when I have two files. First file has 4 columns and the second file has 2 columns. I need to compare 3rd column of the first file with the first column of the second file. I am looking for efficient C code. Do I have to convert the file into an array? How can I do that?
This is my part of code where I tried to convert a 3rd column into an array but it does not work because of incompatible types:
int countlines = 0;
char names[countlines][100];
double column1;
char column2[15];
char column3[15];
int column4;
while(!feof(pack)) {
fscanf(pack, "%lf %s %s %i\n", &column1, column2, column3, &column4);
names[countlines] = column3;
countlines++;
}