I would like to create a function that receives a .txt
file and does something with it, but I do not know how to set the send and receive parameters, or if I should do parameter passing by reference.
Send file to function: funcaoRecebeArquivo(arquivo);
I'm not sure what to put inside the parentheses when I call the function and send the file. An outline of code below:
funcaoRecebeArquivo(arquivo)
{
//Receber o arquivo e fazer algo com ele aqui dentro
}
int main ()
{
FILE *sensvalid;
if ((sensvalid = fopen("X10Map.txt","r")) == NULL)
{
printf("Nao consegui abrir o arquivo X10MAP.");
return 2;
}
funcaoRecebeArquivo(arquivo);
return 0;
}