C++ ofstream not writing to output file?
问题 The code is supposed to count the number of a, b, c, d, e, and f characters in the input text file and print the output into a second text file. When I run the code, it creates the output file but doesn't write anything into it. #include<iostream> #include<fstream> #include<cmath> using namespace std; int main(){ // establish counters for the number of each character char x; int acount=0; int bcount=0; int ccount=0; int dcount=0; int ecount=0; int fcount=0; ifstream iFile("plato.txt"); /