title: Opening files in CUDA C
body: <p>I am trying to open two files(linoteste.ima and sysmattest.dat) they both contain one matrix. After successfully opening the files, when I print them, I only get matrices containing zeros and I don't know what I am doing wrong. This is not a CUDA related problem but a C one, its just that I am opening the files to do matrix multiplication with CUDA. My code is as follows (I have tried replacing fread with a while cicle to read one element at a time, but it does not work):</p>
  
  <pre><code>    float*matlino=(float*)malloc(sizeof(float)*100*100);
  float*matsys=(float*)malloc(sizeof(float)*10000*10000);
  
  //Open linogram
  FILE * flino, *fmat;
  flino = fopen ("linoteste.ima","r");      //also tried with "rb" instead of "r"
  if (flino!=NULL)
  {
      fread (matlino,sizeof(float),100*100,flino);
      fclose (flino);
      puts("Linograma aberto com sucesso");
  }
  else
      puts("impossivel abrir linograma");
  printMat(matlino,10,10);
  
  //Open system matrix
  
  fmat = fopen("sysmattest.dat","r"); 
  if (fmat!=NULL)
  {
      fread (matsys,sizeof(float),10000*10000,fmat);
      fclose (fmat);
      puts("Matriz sistema aberta com sucesso");
  }
  else
  puts("impossivel abrir matriz sistema");
  </code></pre>
  
  <p>Thanks in advance!</p>