it compiles but it tells me segmantation fault any help?Code:#include <stdio.h> #include <stdlib.h> int getsize(void){ int counter=0; FILE *testa; testa=fopen("error.txt","r"); char *c; while(fscanf(testa,"%s",c)!=EOF) counter++; printf("%s",c); return counter; } int main(){ int size; size=getsize(); return 0; }
the txt file contains numbers with a space of each one