I have searched and read that the ^ modifier states to ignore whatever you put inside of the [ ] in scanf
. For example:
int val;
scanf("%[^abc] %d, &val);
printf("val is %d", val);
Now, if I input abc42, I thought the abc would be ignored and 42 would get stored into val. But, this doesn't happen.
I also tried to suppress the scanf
by making it:
scanf("%*[^abc] %d, &val);
but this did not work either. So I am confused on what ^ actually does.