-1
Hello, would you like a help with this code snippet, could someone explain to me what it does exactly ? (Especially the part %*1[ n])
scanf(%[^\n]%*1[\n], string);
-1
Hello, would you like a help with this code snippet, could someone explain to me what it does exactly ? (Especially the part %*1[ n])
scanf(%[^\n]%*1[\n], string);
2
%[^\n]
: reads a string until you find a ' n' (end of line).
%*1[\n]
: this * right after the % indicates that what is read will not be assigned to any variable (in this case to discard ENTER).
Browser other questions tagged c scanf
You are not signed in. Login or sign up in order to post.
Mr Robot, that’s called Regular expressions, is a form of input "formatting and validation". I don’t know exactly what the formatting is in your code, but do a search to know better.
– welington2632
@welington2632 in this case nay are regular expressions, are formatting codes for scanf function
– zentrunix