ahmed0saber

Create a C++ file in C++

Nov 5th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. int main()
  4. {
  5.   ofstream MyFile("filename.cpp");
  6.   MyFile<<"#include <iostream>"<<endl<<"using namespace std;"<<endl<<"int main(){int a=100;cout<<a;}";
  7.   MyFile.close();
  8. }
Advertisement
Add Comment
Please, Sign In to add comment