Returning Array from a function
Hello everyone. Im tryng to return array; from a function but its not working. Any ideas ?
Hello everyone. Im tryng to return array; from a function but its not working. Any ideas ?
Code:
char le(FILE *arq, char texto[50])
{
texto = "";
char c; int x=0;
while(c!='#' && c!='}')
{
c = getc(arq);
if(c!='#' && c!='}' && c!='{') {texto[x] = c;x++;}
}
int tam = strlen(*texto); *texto[tam+1] = '\0';
return texto; // COMPILER ERROR HERE <<
}