logo codesdope

Confusion about file creation


Is a file a physical entity on your computer when created with fopen(“name”, “w”); , or is it just stored in memory? I named a file “test” and printed the string test and the integer 49 to it, but when I searched for a file named test on my computer is was not to be found. Am I supposed to see a physical file, or is it just stored in memory?


  •    Amit Kumar , I.I.T. Patna

    Yes, it must be a physical file. If it is successfully created then it must be on your computer. You haven’t specified any path, so it must be in the same folder where your C code is.

    • Where is my C code? I’m just using the devC++ compiler, it runs a program but I dunno like “where” it is, can you elaborate? I’m new to this sorry c:
      - Ben
    • You can choose your location by saving the file in the desired place using save as or just make a file anywhere in your computer and then open it with your compiler.
      - Amit Kumar

Share what you know
Write your answer

Welcome.please sign up.


Welcome.please login.