To make a self-reproducing program in C, we start with a first incorrect but enlightening attempt. This shows the general plan of trying to print a string with an embedded quoted version of itself.
The result of running this first program exhibits a problem, however. It does not properly quote the quoted symbols within the string.
As second more complicated and correct attempt introduces a quoting function that properly quotes symbols within the string when it is printed as a string.
In a programming language without some nesting print function like
printf of C one can implement a printf-like function to
use this same scheme.
Dan points out he's a trained scientist. Asok asks Dan about the training. That's the kind of training you'll get here.