C fscanf - formatting input

Viewed 145

How can I format fscanf to format the input {'name surname', 'username', points} to strings which do not contain apostrophes

fscanf(fp,"{%s %s %d}",name,username,username1);
1 Answers

This should work:

fscanf(fp,"{'%[a-zA-Z ]', '%[a-zA-Z ]', %d}",name,username,username1);
Related