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;
}

Recommended Answers

All 2 Replies

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.

sorry missed that little tid bit. i guess ill go back and try it agian.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.