S
Shankar
#include<stdio.h>
int main()
{
char str1[5]="abcd";
.... snprintf(str1, 5, "%s", str1);
printf("\nOutput=\"%s\"\n", str1);
return 0;
}
Questions:
1. Whats the output of this program and why?
2. Why is it different when I use sprintf(str1, "%s", str1); ?
int main()
{
char str1[5]="abcd";
.... snprintf(str1, 5, "%s", str1);
printf("\nOutput=\"%s\"\n", str1);
return 0;
}
Questions:
1. Whats the output of this program and why?
2. Why is it different when I use sprintf(str1, "%s", str1); ?