[Solved] Why text file created is blank?


Your buffer is likely not being flushed.

Try this:

while(1){
  //...
  fout.flush();
}

2

solved Why text file created is blank?