hi frns,
my problem is i have to write C++ code and that has to produce a text file as output..which command in C++ will do that..pls solve my problem if any one can do...
#include <fstream>
#include <iostream>
int main() {
std::ifstream myFile; // Create ofstream (output filestream) object
myFile.open("myFile.txt"); // Open a file
if (myFile.is_open()) { // Check file is open
while(!(myFile.eof())) { // Check that we haven't read past the last line
getline(myFile, line); // Get each line
std::cout << line; // Print the line
}
}
myFile.close(); // Close file
return 0;
}