Write a program that, when run, will print out its source code. This source code, inWrite a program that, when run, will print out its source code. This source code, in turn, should compile and print out itself. turn, should compile and print out itself. :p

Recommended Answers

All 6 Replies

Write a program that, when run, will print out its source code. This source code, inWrite a program that, when run, will print out its source code. This source code, in turn, should compile and print out itself. turn, should compile and print out itself. :p

Sounds like a virus to me... You won't find anyone to help you out with that here.

Sounds like a virus to me... You won't find anyone to help you out with that here.

It's called a quine. They're completely harmless diversions.

It's called a quine. They're completely harmless diversions.

If I understand the OP's intentions correctly, its not just a quine - the description looks to me as if it would be an infinite recursive loop, that would increasingly swallow more and more memory & HD space :

This source code, in turn, should compile and print out itself. turn, should compile and print out itself.

If I understand the OP's intentions correctly, its not just a quine - the description looks to me as if it would be an infinite recursive loop, that would increasingly swallow more and more memory & HD space :

I think that was more of an awful copy and paste job than a part of the problem description. ;)

I think that was more of an awful copy and paste job than a part of the problem description. ;)

Heh, quite possibly ;) its hard to tell with some people :)

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.