![]() |
Sprintf .....
Hi guys ,,
Can anyone out there tell me what is sprintf " SAvio |
Re: Sprintf .....
"Savio" <saviochacko@gmail.com> wrote in message
news:1128101348.959993.56630@g47g2000cwa.googlegro ups.com... > Hi guys ,, > > Can anyone out there tell me what is sprintf " > > SAvio > Try this link: http://ccs.ucsd.edu/c/stdio.html#sprintf This one might help too, although itz technically specific to the Linux OS: http://man.he.net/?topic=sprintf§ion=all By the way, quite often with questions like this Goggle is your friend. -Charles |
Re: Sprintf .....
Savio wrote On 09/30/05 13:29,: > Hi guys ,, > > Can anyone out there tell me what is sprintf " Like printf(), except that its "output" goes into a character array that you provide instead of being sent to stdout. The array must be large enough to hold all the characters plus a terminating '\0'. -- Eric.Sosman@sun.com |
Re: Sprintf .....
"Savio" <saviochacko@gmail.com> writes:
> Hi guys ,, > > Can anyone out there tell me what is sprintf " > > SAvio Does your C implementation include documentation? On any Unix-like system, "man sprintf" should provide all the information you need; I don't know about other systems. Any decent book on C should explain sprintf. If you don't have a decent C book, you should get one. Kernighan & Ritchie's _The C Programming Language_, 2nd Edition, is an excellent tutorial. Harbison & Steele's _C: A Reference Manual_, 5th Edition, is an excellent reference. You're posting through groups.google.com. You should be aware that Google also provides an excellent web search engine. There are all things you should try *before* posting to Usenet. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this. |
Re: Sprintf .....
Savio wrote on 30/09/05 :
> Can anyone out there tell me what is sprintf " Please open your C-book. -- Emmanuel The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html The C-library: http://www.dinkumware.com/refxc.html "C is a sharp tool" |
Re: Sprintf .....
"Savio" <saviochacko@gmail.com> wrote in message
news:1128101348.959993.56630@g47g2000cwa.googlegro ups.com... > Hi guys ,, > > Can anyone out there tell me what is sprintf " printf() writes a string to the output (the screen or whatever). sprintf() writes one string into another string. Remember, you have to allocate memory for the string you write to! You use it to build a string you want to output later, so if you might want to put the first name, then the last name, then the zodiac sign into a string, you would use sprintf() to do it. -- Mabden |
Re: Sprintf .....
Mabden wrote:
> "Savio" <saviochacko@gmail.com> wrote in message > news:1128101348.959993.56630@g47g2000cwa.googlegro ups.com... > >>Hi guys ,, >> >> Can anyone out there tell me what is sprintf " > > > printf() writes a string to the output (the screen or whatever). > sprintf() writes one string into another string. Remember, you have to > allocate memory for the string you write to! > > You use it to build a string you want to output later, so if you might > want to put the first name, then the last name, then the zodiac sign > into a string, you would use sprintf() to do it. Apart from that: If you use a C99 implementation or if your standard library contains the function, use snprintf() instead of sprintf() as you can easier avoid buffer overflows and similar -- and have a chance to find out that the output has been truncated. See for example the excellent C99 library reference at dinkumware.com for more information. Cheers Michael -- E-Mail: Mine is an /at/ gmx /dot/ de address. |
| All times are GMT. The time now is 09:08 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.