John Matthews wrote:
> --- In [email protected], ed <[EMAIL PROTECTED]> wrote:
>> On Sat, 19 Jul 2008 12:32:23 -0000
>> "John Matthews" <[EMAIL PROTECTED]> wrote:
>>
>>> --- In [email protected], Thomas Hruska <thruska@> wrote:
>>>> kathir resh wrote:  
>>>>> since printf is function it returns the no of characters  
>>>>> printed...how to view the no of charaters it returns.....
>>>> printf("%d\n", printf("Hi!\n"));  
>>> Slight variation:
>>>
>>> printf("%d\n", printf("no of characters = "));
>>>
>> How do you know when flush is called? It could be after the nested
>> function, although it should happen after writing \n, it's possible for
>> it to happen before the outer printf I believe.
> 
> Sorry Ed- not sure I understand. Does it matter when the flush
> happens, as long as the characters go into the output stream in the
> expected order ie. inner before outer? And isn't that guaranteed by
> the inner printf having to be evaluated before the outer executes?
> 
> To be honest I wasn't sure myself whether this 'nesting' of printfs is
> ok, but if Thomas thinks it is, that's good enough for me :-)
> 
> John

I never really said that it is okay.  I don't generally nest function 
calls (line length and the number of parenthesis starts getting kind of 
hairy).  But, in this case, I assumed it was for some sort of debugging 
purpose.  In which case, it probably is fine.

Alternatively, the person could use a temporary variable to accomplish 
the same goal.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to