Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

a quine in C++?

13 views
Skip to first unread message

John David Regehr

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to

In C, a way to get a program to print itself as output is to use the
same string twice; once as a format string for printf, and once as a
literal string.

Does anybody have a program that prints itself using C++ style I/O? It
seems to me that it would be difficult since ostreams prevent us from
interpreting a string in two different ways.

This has been bugging me recently. Any quines or pointers to relevant
articles or web pages is appreciated. Thanks!

--
John Regehr

0 new messages