printf function help

Tarun Karra plug-devel@lists.PLUG.phoenix.az.us
Mon Mar 1 12:22:02 2004


--0-1926042441-1078168720=:21850
Content-Type: text/plain; charset=us-ascii

hi,
 
Iam sorry i think i didnt make the question right first time
 
Can you please run the program below and give me a reason for the output
#include <stdio.h>
int main()
{
printf("%d") ;
return 0;
}

watchout
> printf("%d",x) ;
there is no x my program. Its only **********printf("%d") ;******************
my program still compiles and prints out value 34603777
 
Can any one give me a reason for this output. 
thx
tarun
 
 


coberr@scottsdaleins.com wrote:

%d prints the value of argument in signed decimal notation. For example,
this will print the value of x.

#include 
int main()
{
float x=10;
printf("%d",x) ;
return 0;
}


Try 'man 3 printf' for details....





Tarun Karra 
T 
To: plug-devel@lists.PLUG.phoenix.az.us 
Sent by: cc: 
plug-devel-admin@lists.PLU 
G.phoenix.az.us bcc: 
Subject: printf 
function help 

03/01/2004 11:45 AM 
Please respond to 
plug-devel 






hi ,,

what does this program print and why
I know printf can take variable arguments..
how does compiler treat %d in this program..
#include 
int main()
{
printf("%d") ;
return 0;
}

thx
tarun


Do you Yahoo!?
Get better spam protection with Yahoo! Mail








_______________________________________________
PLUG-devel mailing list - PLUG-devel@lists.PLUG.phoenix.az.us
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-devel

---------------------------------
Do you Yahoo!?
Get better spam protection with Yahoo! Mail
--0-1926042441-1078168720=:21850
Content-Type: text/html; charset=us-ascii

<DIV>hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Iam sorry i think i didnt make the question right first time</DIV>
<DIV>&nbsp;</DIV>
<DIV>Can you please run the program below and give me a reason for the output</DIV>
<DIV>#include &lt;stdio.h&gt;<STDIO.H><BR>int main()<BR>{<BR>printf("%d") ;<BR>return 0;<BR>}<BR></DIV>
<DIV>watchout</DIV>
<DIV>&gt; printf("%d",x) ;<BR>there is no x my program. Its only **********printf("%d") ;******************</DIV>
<DIV>my program still compiles and prints out value 34603777</DIV>
<DIV>&nbsp;</DIV>
<DIV>Can any one give me a reason for this output. </DIV>
<DIV>thx</DIV>
<DIV>tarun</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><BR><B><I>coberr@scottsdaleins.com</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>%d prints the value of argument in signed decimal notation. For example,<BR>this will print the value of x.<BR><BR>#include <STDIO.H><BR>int main()<BR>{<BR>float x=10;<BR>printf("%d",x) ;<BR>return 0;<BR>}<BR><BR><BR>Try 'man 3 printf' for details....<BR><BR><BR><BR><BR><BR>Tarun Karra <BR><TARUN820@YAHOO.COM>T <BR>To: plug-devel@lists.PLUG.phoenix.az.us <BR>Sent by: cc: <BR>plug-devel-admin@lists.PLU <BR>G.phoenix.az.us bcc: <BR>Subject: printf <BR>function help <BR><BR>03/01/2004 11:45 AM <BR>Please respond to <BR>plug-devel <BR><BR><BR><BR><BR><BR><BR>hi ,,<BR><BR>what does this program print and why<BR>I know printf can take variable arguments..<BR>how does compiler treat %d in this program..<BR>#include <STDIO.H><BR>int main()<BR>{<BR>printf("%d") ;<BR>return 0;<BR>}<BR><BR>thx<BR>tarun<BR><BR><BR>Do you Yahoo!?<BR>Get better spam protection with Yahoo!
 Mail<BR><BR><BR><BR><BR><BR><BR><BR><BR>_______________________________________________<BR>PLUG-devel mailing list - PLUG-devel@lists.PLUG.phoenix.az.us<BR>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-devel</BLOCKQUOTE><p><hr SIZE=1>
Do you Yahoo!?<br>
Get better spam protection with <a href="http://us.rd.yahoo.com/mailtag_us/*http://antispam.yahoo.com/tools">Yahoo! Mail</a>
--0-1926042441-1078168720=:21850--