T
thomas
Hi,
I used to see a format specifier "%s%n" for "scanf", like
follows.
------------code---------
#include<iostream>
using namespace std;
int main(){
char xx[20];
strcpy(xx, "ab ad ef");
char yy[20]; int jj;
cout<<sscanf(xx, "%s%n", yy, &jj)<<endl;
cout<<yy<<" "<<jj<<endl;
}
--------code-----------
But I didn't find any explaination about the "%n" usage in the web or
text books.
Can anyone give some references?
I used to see a format specifier "%s%n" for "scanf", like
follows.
------------code---------
#include<iostream>
using namespace std;
int main(){
char xx[20];
strcpy(xx, "ab ad ef");
char yy[20]; int jj;
cout<<sscanf(xx, "%s%n", yy, &jj)<<endl;
cout<<yy<<" "<<jj<<endl;
}
--------code-----------
But I didn't find any explaination about the "%n" usage in the web or
text books.
Can anyone give some references?