Connecting Tech Pros Worldwide Forums | Help | Site Map

Is it fine??

Money
Guest
 
Posts: n/a
#1: May 28 '06
Is there any problem in using printf for printing the source of the
program.

Here
http://groups.google.co.in/group/com...2f7003e0d2b363

Andrew Koenig somewhat discourages to use printf to solve such problem.

Any suggestions?


Luke Meyers
Guest
 
Posts: n/a
#2: May 28 '06

re: Is it fine??


Money wrote:[color=blue]
> Is there any problem in using printf for printing the source of the
> program.
>
> Here
> http://groups.google.co.in/group/com...2f7003e0d2b363
>
> Andrew Koenig somewhat discourages to use printf to solve such problem.
>
> Any suggestions?[/color]

Well, it's kind of a toy problem, so points of disagreement on it are
more likely to be based on aesthetic concerns than software engineering
concerns of real consequence. printf has known problems which are
sufficient to avoid it in practice; I see no reason why they are any
more or less valid in this context. It all depends on your
desirements. For toy problems, if it works, it works.

Luke

Andrew Koenig
Guest
 
Posts: n/a
#3: May 28 '06

re: Is it fine??


"Money" <spicymonchi@gmail.com> wrote in message
news:1148829365.749537.11550@i40g2000cwc.googlegro ups.com...
[color=blue]
> Here
> http://groups.google.co.in/group/com...2f7003e0d2b363
>
> Andrew Koenig somewhat discourages to use printf to solve such problem.[/color]

No, not really. What I'm saying in the posting to which you refer is that I
don't think it's quite cricket to rely on knowing what the output of the
following statement will be:

printf ("%c", 34);



Closed Thread