Hi all
Whenever I try to compile this code, I get
cc: Error: readtopps.c, line 3: In this declaration, "data" has no linkage and is of an incomplete type. (incompnolink)
int data[];
What does the error message means?
Thanks,
#include <stdio.h>
int* readtopps (char fn[]){
int data[];
int n,i;
FILE* fp;
fp=fopen(fn,"r"
fscanf(fp,"%d",&n);
data=(int*)malloc(sizeof(int)*n);
for (i=0;i<n;i++)
fscanf(fp,"%f",&data);
fclose(fp);
return(data);
}
Whenever I try to compile this code, I get
cc: Error: readtopps.c, line 3: In this declaration, "data" has no linkage and is of an incomplete type. (incompnolink)
int data[];
What does the error message means?
Thanks,
#include <stdio.h>
int* readtopps (char fn[]){
int data[];
int n,i;
FILE* fp;
fp=fopen(fn,"r"
fscanf(fp,"%d",&n);
data=(int*)malloc(sizeof(int)*n);
for (i=0;i<n;i++)
fscanf(fp,"%f",&data);
fclose(fp);
return(data);
}