I went through all sorts of quine problems, but my task was to get a quine problem without main()
, and loops are also forbidden.
Without loop, it is easy, but I can't figure out how to write one without main()
. Can anyone help me or provide me with a link?
You cannot create a (non-freestanding) C program without a
main()
function. Thus, creating a quine in C without amain()
is impossible in the usual sense.That said, depending on how you define a quine, you might be able to construct a source file which fails to compile, but for which the compile error (on a certain specific compiler) is the contents of the source file.