You must make hexArray
static
either by doing this:
char *saveToArray(FILE *hexFile)
//metodo que devolve uma array contendo uma linha do ficheiro
{
static char hexArray[32];
fgets(hexArray, sizeof hexArray, hexFile);
return hexArray;
}
Or, by doing this:
char hexArray[32];
int main(int argc, char* argv)
{
char ch;
...