ok, if i don't use a cast, i modify the main in this way:
Code:
int main ()
{
  FILE * pFile;
  FILE * image;
  int c;
  pFile=fopen ("bitstream.txt","r");
  image=fopen ("image.jpc","w");
  if (pFile==NULL) perror ("Error opening file");
  else
  {
    
      c = fgetc(pFile); 

      while (c != EOF)
    {
              ByteFromText(c, image);
         c = fgetc(pFile); 
    
    } 
        }
    fclose (pFile);
        fclose (image);

  
  return 0;
}
and the program doesn't compile. g++ outputs this message:

error: invalid conversion from ‘int’ to ‘char*’
error: initializing argument 1 of ‘char ByteFromText(char*, FILE*)’.

concerning the result of fgetc, i don't know how to answer
how can i measure the number of characters output? the only thing i can see is that a file named image.jpc empty is generated