Usage Of %n

0 views
Skip to first unread message

Arun Prasath

unread,
Jan 6, 2005, 8:47:50 AM1/6/05
to CppF...@googlegroups.com
Hi all,

In 'C' i seen one format string %n and one example to
explain abt that.


Program:
**********

int main()
{
char a[]="WELCOME";
int i;
printf("%s%n",a,&i);
printf("The Total No of Printed Character is: %d",i);
return 0;
}


Output:
********
The Total No of Printed Character is: 7


Is this only the purpose of %n. I want to know some more abt it. If u
know any other functionality of %n plz give ur explanation with sample
code..


Thanks to all.

Senthil Raj

unread,
Jan 7, 2005, 3:03:36 AM1/7/05
to CppF...@googlegroups.com
Hi Arun,

Looks interesting.. I have tried the code and it gives me the same
output.
I couldnot find anything relevant to your query.

Senthil...

Reply all
Reply to author
Forward
0 new messages