I am facing a serious issue with sprintf.
Suppose my code snippet is:
sprintf(Buffer,"Hello World");
sprintf(Buffer,"Good Morning");
sprintf(Buffer,"Good Afternoon");
.
.
.
Some hundred sprints....
If I do like this, its getting overwritten.
How can I avoid overwritting using sprintf. If I give a printf at the end I want to see all the lines.
You need:
sprintf(Buffer,"Hello World");
sprintf(Buffer + strlen(Buffer),"Good Morning");
sprintf(Buffer + strlen(Buffer),"Good Afternoon");
and of course you need your buffer to be big enough.