please help me with sscanf() function detailing with an example..
Also try to help me with this program
Code:
#include<stdio.h>
void main()
{
char buffer[50];
int no=97;
double val=2.34174;
char name[10]="Shewta";
clrscr();
sprintf(buffer,"%d %lf %s",no,val,name);
printf("\n%s",buffer);
sscanf(buffer,"%4d %2.2lf %s",&no,&val,name);
printf("\n%s",buffer);
printf("\n%d %lf %s",no,val,name);
getch();
}
Also please tell what format specifiers like (4 and 2.2 in above program) do in scanf() funtion.I know about their usage in printf() but unable to understand in scanf().