Hey!
How does this work:
Like what does this >>>>%[^\n]<<<< do? I mean, how does it work?Code:scanf("%[^\n]", x)
Thanks
Hey!
How does this work:
Like what does this >>>>%[^\n]<<<< do? I mean, how does it work?Code:scanf("%[^\n]", x)
Thanks
anything but a newline.
google regular expresions
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
>google regular expresions
scanf doesn't have regular expressions.
These are scan sets ( or inverted scan sets if they begin with a ^ )
> Like what does this >>>>%[^\n]<<<< do? I mean, how does it work?
Think of %s being similar to %[^ \t\r\n]
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
what this basically saying is read anything from the input buffer other than '\n' charCode:%[^\n]
ssharish2005