I tried to do some things with scanning in scanf, but got stuck somewhere.
when I write
char s1[250];
scanf("%[A-Z]s",s1);
input : AHJHkiuy
Output: AHJH
and wherein
scanf("%[^\n]s",s1);
input: abcd ABCD hie
output: abcd ABCD hie
Now my question is: if I give input like:
ABCDahaj ahajABCD ajak12347ab
and you want the result to be as follows:
ABCDahaj ahajABCD ajak
then how should the format string be written? That is, how should this scan be used?
source
share