Note that there are some explanatory texts on larger screens.

plurals
  1. POfopen() does not working well with gvim editor
    primarykey
    data
    text
    <p>First, I can't speak ENGLISH very well.. please understand :)</p> <p>When I try to open text file to write something using fopen() with gvim, e.g. <code>FILE *f = fopen("data.txt", "w");</code>, I can't find the data.txt file anywhere.. not only current directory but in Windows Explorer. BUT..It's working fine without the file. :|</p> <p>I had doubts, So I've tried this <code>FILE *f = fopen("c:\my\..."data.txt", "w");</code> Specify path, Working good!</p> <p>I know that text file is stored in the same folder as in execution file folder.</p> <p>Of course, Other IDE is working very well.(MSVS or Dev C++) What's my problem??</p> <p>(I'm using Windows7 and gvim.)</p> <pre><code>// Modification // source code #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; int main(void) { FILE *f = NULL; int name[10]; if((f = fopen("data.txt", "w")) == NULL){ printf("sorry..\n"); system("pause"); exit(1); } fprintf(f, "%s\n", "Dennis"); fclose(f); if((f = fopen("data.txt", "r")) == NULL){ printf("sorry2..\n"); system("pause"); exit(1); } fscanf(f, "%s", name); printf("%s\n", name); fclose(f); system("pause"); return 0; } // I think it's no problem. I've tried different ways to try several times. </code></pre> <p>I will compile this -> map :! gcc % -o %&lt;.exe (in vimrc. file) Push Cntl + F9. Vim 7.3, MingW 0.1-alpha-5. I just coding some source code, there are fopen(), fprintf() and fscanf(). When I tried to write on text file that I opened file, something was written there. but I could not see the text file. And, I tried to read the text file that I wrote file, although It was open, could not be read. Windows Explorer could not find the text file. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload