fork download
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. //code for week2 homework c++
  5. int main() {
  6. const char fileName[]="./myStore.txt";
  7. ofstream myfile;
  8. int myStory;
  9. cout << "Hello, user! Let's create your file. We're processing file myStory";
  10. cin >> myStory;
  11. myfile.open("myStory.txt");
  12. myfile << "I love to code.\n";
  13. myfile << "I really love to code in C++.\n";
  14. myfile << "Coding makes me very happy.\n";
  15. myfile << "Give me more code to write.\n";
  16. myfile.close();
  17. return 0;
  18. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Hello, user! Let's create your file. We're processing file myStory