I have been assigned to try and figure out how to write a program that prints itself. So far, this is what I've been able to come up with:
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream in_stream;
int main()
{
string quine;
in_stream.open("main.cpp");
in_stream >> quine;
cout << quine << endl;
return 0;
}
I'm still fairly new to programming, so I can't figure out how to make it output more than just the first line. Any help would be greatly appreciated.