0

I need to read the text using scanf, but what I know scanf is reading characters to the first space. I don't know that it's possible to read more words into the array by scanf and i have no any idea.

anocyney_
  • 1
  • 3

1 Answers1

0

That's not correct; scanf reads according to the format string you give it.
Nothing keeps you from using a format that reads past spaces, returns, or whatever else, for example scanf("%50c",buffer); will read 50 characters, no matter what they are; or scanf("%[^|]", buffer); will read everything up the first |. Read up on the definition of the scanf family.

Aganju
  • 6,295
  • 1
  • 12
  • 23