English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

7 answers

Look up "quine" on wikipedia. That will tell you everything you need to know.

2006-07-03 17:57:21 · answer #1 · answered by Pascal 7 · 0 0

In what language?

Am I to assume the source code is available or do I need to assume only the object code is available?

If former:
A source code must be stored somewhere... either in a file or in a memory space. Either in plain text or in P-code. (intermediate code) Knowing how the source code is stored will show you what/where they must be accessed. Then it is a simple matter of writing a program to dump the content (and translate it if necessary) to the standard output.

If latter:
You'll have to write a de-compiler first. Then compile the de-compier. Runing the de-compiler through itself, it should produce the source code.

2006-07-03 18:01:54 · answer #2 · answered by tkquestion 7 · 0 0

Read the source code (text) file in the program itself then do whatever you want with it.

2006-07-03 17:58:09 · answer #3 · answered by Melvin 4 · 0 0

Well you can store whole source code as a constant and print out the constant once it runs.

2006-07-03 17:56:15 · answer #4 · answered by moin_anjum 5 · 0 0

way to do it --> program ur program to copy files then Copy ur source code to a temp file . Open it and print ur result. delete ur temp file.
Very simple. i havent try it out yet. but the theory sounds correct.

2006-07-03 18:00:04 · answer #5 · answered by ek_is_jou_pa 2 · 0 0

Actually doing this is a bit complicated. Think about it, if you were to just try and print it out using print statements the more you put in your print statement the more you have to put in. Read the wiki, its quite helpful.

2006-07-03 19:15:10 · answer #6 · answered by Steve T 3 · 0 0

this is been finished. look on the internet. 2 options: both you need to have a loop so it may print this is personal sourcecode two times with out genuinely including it two times. the different option became dishonest: A software that study and printed its personal sourcefile. I beloved that one for questioning outdoors the field :)

2016-11-30 06:19:50 · answer #7 · answered by Anonymous · 0 0

fedest.com, questions and answers