473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

nested printf

Hi friends,

Can u plz tell me why
printf("%d",printf(" Hello World "));
prints Hello World13.
Please explain the concept in detail.

Thanks
Sooraj

May 3 '06 #1
3 3115

soorajk...@gmail.com wrote:
Hi friends,

Can u plz tell me why
printf("%d",printf(" Hello World "));
prints Hello World13.
Please explain the concept in detail. From the man page for printf:

Upon successful return, these functions return the number of
characters printed ...

The inner printf printf " Hello World " and returns the number of
characters printed, namely 13. The outer printf then prints "13".

May 3 '06 #2
so********@gmail.com wrote:
Can u plz tell me why
printf("%d",printf(" Hello World "));
prints Hello World13.
Please explain the concept in detail.

Didn't someone asked this very question in this newsgroup recently? I
recall because I had never seen this construct before, though the answer
did not surprise me in the least.
May 3 '06 #3
so********@gmail.com wrote:
# Hi friends,
#
# Can u plz tell me why
# printf("%d",printf(" Hello World "));
# prints Hello World13.
# Please explain the concept in detail.

Lisp serialisation.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
She broke your heart and inadvertently drove men to deviant lifestyles.
May 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin Schou | last post by:
Please ignore the extreme simplicity of the task :-) I'm new to C, which explains why I'm doing an exercise like this. In the following tripple nested loop: int digit1 = 1; int digit2 = 0;...
10
by: nimmi_srivastav | last post by:
Below you will see an example of a nested conditional expression that this colleague of mine loves. He claims that it is more efficient that a multi-level if-else-if structure. Moreover, our...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
11
by: charlie | last post by:
I recently came across s function (actually many) whose structure is a series of nested ifs with the meat of the function at the very centre: if (condition1) if (condition2) if (condition3) if...
4
by: so.intech | last post by:
for example, ret = 0; for(i=0; i<3; i ++;) { for(j=0; j<4; j++;) { for(k=0; k<3; k++;) { for(m=0; m<4; m++;) {
6
by: Polomora | last post by:
Hello. I've done a bit of searching here on c.l.c, and I also checked out SMC at soureforge, but haven't been able to find what I'l looking for. I've got two FSMs: A and B, where I want to...
3
by: dasarisrikar | last post by:
Hi,i hav executed the following c code...the inner printf executes first to print some garbage value...why dont the outer printf prints anything..... I got only one garbage value ..y dont two...
2
by: chiefs | last post by:
I'm a beginner in C++!! #1-Dont know how to loop end when int q(entered); int q is a very large # when ran: printf("\n%i#of Questions\n", q); #2-is the line "how many questions Right"?...
8
by: Sheldon | last post by:
Hi, Can anyone help with this problem with setting up nested structures and initializing them for use. I have created several structs and placed them in a super struct that I will then pass to...
4
by: S. | last post by:
Hi all, I have the requirement that I must pass-by-reference to my function addStudent() and getAge() functions where my getAge() function is within the addStudent() function. I am able to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.