Reputation: 163
char a[200] = { 0 };
char tst[20] = "aaaa 123\n";
int i;
sscanf_s(tst, "%s %d",a, &i);
printf("reasult:%s %d", a,i);
No matter I use char tst[20] = "aaaa 123\n";
or char* tst = "aaaa 123\n";
,
it always shows access violation.
I need to seperate a string an integer from a string. But why this happens ?
Upvotes: 0
Views: 556