A
aarklon
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int x; char ch;
char string[20] = "100 5";
sscanf(string,"%3d%c",&x,&ch);
printf("\n... %d %c",x,ch);
return EXIT_SUCCESS;
}
is giving o/p ... 100, that's ok but,
but
sscanf(string,"%3d%2c",&x,&ch);
printf("\n... %d %c",x,ch);
is giving o/p ... 53 , why ....????
#include<stdlib.h>
int main(void)
{
int x; char ch;
char string[20] = "100 5";
sscanf(string,"%3d%c",&x,&ch);
printf("\n... %d %c",x,ch);
return EXIT_SUCCESS;
}
is giving o/p ... 100, that's ok but,
but
sscanf(string,"%3d%2c",&x,&ch);
printf("\n... %d %c",x,ch);
is giving o/p ... 53 , why ....????