I’m trying to read strings without commas and dots using fscanf().
Example input:
“Mr. and Mrs. Dursley, of number four, Privet Drive, were proud to say that they were perfectly normal, thank you very much.”
I want to read “Mr”, “Mrs” and “Dursley” each time e.g
I tried several ways to do this using optional arguments, but I failed. How can I ignore the commas and dots using fscanf()?
You can use the regex feature of sscanf to do this.
To keep going, you will need to use the return value of
sscanf(orfscanf) to identify how many characters were matched. I leave that to you.