sscanf(line, "%d %64[^\n", &seconds, message);
does %64[^ mean – up to 64 characters?
Should it work with GNU C Compiler?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It means “read at most 64 characters or stop when reaching a newline, whichever comes first”. It’s specified by the standard so all standard libraries have to support it.
As noted in the comments, a matching
]is probably required to delimit the scanlist. Ansspecifier is not required.