123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
int main (); { string inputFilename; string outputFilename; string line; ifstream infile; ofstream outfile; cout << "Enter input file name: "; cin >> inputFilename infile.open(inputFilename.c_str()); if (!infile) { cerr << inputFilename << " not found" << endl; exit (0); } cout << "Enter output file name: "; cin >> outputFilename; outfile.open(outputFile.c_str()); if (!outfile) { cerr << "unable to create " << outputFilename << endl; exit(0); } string ss; cin >> ss; while (getline(infile line)) { for (int i = 0; i < line.length(); i++) { for (int x = 0; x < ss.length(); x++) { if (line.at(i) = '*'; outfile << ss.length(x); else outfile << ' '; } } outfile << endl; } infile.close(); outfile.close(); return 0; }
int main (); // Random semicolon is random
cin >> inputFilename // missing semicolon
outfile.open(outputFile.c_str()); // outputFile doesnt exist?
while (getline(infile line)) { // missing coma between infile and line