I need assistance in printing out a Quine. I googled it and stuff, but I didn't understand the code snippets I saw. Can anyone explain in a more lucid tone?

Member Avatar
Member Avatar
+0 forum 3

If you don't know what a quine is, it is a program or script that's only purpose or function is to print out its own source code. I was wondering would this be considered a quine? [CODE] f = open("quine.py","r"); print f.read() [/CODE] quine.py is the script that this code is in. It does print out itself like a quine would.

Member Avatar
Member Avatar
+0 forum 4

Hey all. I have written a quine and I was wondering if I have the jist of it right. I'm not sure if the code needs to be longer or this would be a suitable answer. Here is what I have. btw driver.cpp is the file name for my source code for this program. [code=c++] #include <iostream> #include <fstream> #include <string> using namespace std; int main() { string temp; cout << "this is a simple quine program"; cout << "\nthe sourece code for this program is a follow:\n"; ifstream fin("driver.cpp"); while (getline(fin, temp)) { cout << temp << "\n"; } …

Member Avatar
Member Avatar
+0 forum 2

The End.