sprintf function Demo
Understand how sprintf function works in C programming language with the help of an example. Here we demonstrate sprintf function in C language. If you have any questions, do feel free to comment.
#include#include void main(){ char *str; char *first="Learn", *second = "C", *third="Online"; clrscr(); sprintf(str,"%s%s%s.com is a great site", first, second, third); printf("%s",str); getch(); }
Output:
LearnCOnline.com is a great site
Also See:
Explanation on sprintf function
Output
Learn C Online
I don’t understand how it comes LearnCOnline.com is a great site.