Hi! Newbie here.

I was working on a C project before using Ubuntu, but now I have switched to Windows7 and want to continue my work. I got Qt Creator and was thinking that this would solve all my problems... All I would have to do is start a "plain C project" and copy whatever I had previously. Everything else is going great, except for one thing: the program cannot create data files. Does this mean that the old "FILE" command from C doesn't work in Qt Creator? Or is this possibly some sort of problem with permissions to access files that Qt has?

I read from other threads that there is some sort of "Qt FILE" command to create files, but I want to make sure whether I would be able to use FILE command from C language to create files or not. I could not find an answer with the search button, so I might have been using the wrong keywords..

Also, here is the part of my code that handles the file-making. If there is some way to make it work, I'd like to hear it. :)

Qt Code:
  1. void save_file(np,xp,yp,up,vp,rax,ray,tp,dp,mp,fname,time,fn)
  2. int np,time,fn;
  3. double *xp,*yp,*up,*vp,*rax,*ray,*tp,*dp;
  4. int *mp;
  5. char fname[];
  6. {
  7. FILE *fp;
  8. int i,k;
  9. char fname_full[200];
  10.  
  11. sprintf(fname_full,"%s_nor.%05d",fname,fn);
  12. fp=fopen(fname_full,"wt");
  13. if(fp==NULL) {printf("\n Cannot create file1 %s \n",fname_full);exit(1);}
  14.  
  15. fprintf(fp,"%d\n",np);
  16. for(k=0;k<np;k++)
  17. fprintf(fp,"%lf %lf %7.6e %7.6e %lf %lf %d\n",xp[k],yp[k],up[k],vp[k],tp[k],dp[k],mp[k]);
  18.  
  19. if(fclose(fp)==EOF)
  20. {printf("\n Error in closing file %s \n",fname_full);exit(1);}
  21.  
  22. }
To copy to clipboard, switch view to plain text mode