Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Where does onlinegdb save the text file we create in the program

0 votes
asked Oct 30, 2017 by anonymous
I am very new to programming. Below is the code i have written which creates a file and adds some text to it, I want to open this file on the computer and very if it actually added the text or not. Where does the file gets saved.

#include <stdio.h>

#include <stdlib.h>

int main()

{

  FILE *fp;

  fp=fopen("bacon.txt", "w");

  fprintf(fp, "I love cheese\n");

  fclose(fp);

  return 0;

}

1 Answer

–2 votes
answered Nov 6, 2017 by nick
File is created on server's temporary directory, it is deleted once your program is finished.
if you can to verify the file you created, you can print the content of file via program itself.

here is sample code: https://onlinegdb.com/BJFOmz0C-
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...