Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
MIDL
#include<stdio.h>

int main()
{
pritnf("%%%%%");
}


i have written this code and the out put is
VB
/tmp/ccBawjSg.o: In function `main':
percent.c:(.text+0x11): undefined reference to `pritnf'
collect2: ld returned 1 exit status

why this is so???
and what does this means????
please if anybody knows this then answer

[Edit - Moved here from answer from OP - Henry]
sorry guys by mistake i have executed the wrong code

actualy it is

C++
#include<stdio.h>
int main()
{
printf("%%%%%");
}

and the warning is
Collapse

percent.c: In function ‘main’:
percent.c:5: warning: spurious trailing ‘%’ in format

and output is only "%%" why not it is "%%%%%"

[/Edit]
Posted
Updated 4-Mar-11 7:09am
v2

It's because there is a typo in your code. You wrote "pritnf" rather than "printf".
 
Share this answer
 
Comments
Andrew Brock 5-Mar-11 0:50am    
Observant. 5.
The '%' character indicates the start of a format specification. In order to print a single '%' character, you need to specify "%%" in the format string.

See here[^] for more details.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900