0

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.

#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";
	}
	cin.get();
	return 0;
}

Edited by NathanOliver: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by NathanOliver
Featured Replies
  • Sorry but that is not a quine program (see [URL="http://en.wikipedia.org/wiki/Quine_%28computing%29"]this link[/URL]). [quote]A quine takes no input. Allowing input would permit the source code to be fed to the program via the keyboard, opening the source file of the program, and similar mechanisms.[/quote] Read More

1

Sorry but that is not a quine program (see this link).

A quine takes no input. Allowing input would permit the source code to be fed to the program via the keyboard, opening the source file of the program, and similar mechanisms.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.