I wanna compare an element of a string with a char, what's wrong? i get segmentation fault.
i wanna go trough a string, copyng the part of string until an element of string, when the element=",", but i'm making something of wrong.
passing argument 1 of ‘strcmp’ makes pointer from integer without a cast
char palavra[1000],linha[1000];
int i;
while(fgets(linha, sizeof(linha), df)!=NULL){
i=0;
strcopy(palavra,"0");
while(strcmp(&linha[i],",")!=0){
strcpy(&palavra[i],&linha[i]);
i++;
}
printf("%s,",palavra);
}