why will this write the text to a file:
and this do absolutely nothingCode:ofstream fout("info.txt"); char ch; char word[BUFSIZ]; int i = 0; while (1) { ch = getch(); word[i++] = ch; fout << word; } fout.close();
Code:ofstream fout("info.txt"); char ch; while (1) { ch = getch(); fout << ch; } fout.close();