0

scanf

I wrote two words to char array with scanf but it took only one word. Can you explain?

9th Jan 2019, 10:17 PM
Zeynep Hande CoƟkun
Zeynep Hande CoƟkun - avatar
1 Answer
+ 3
Scanf will read until the first white-space character. You can try gets, even better- fgets instead. https://stackoverflow.com/questions/34007197/scanf-behaviour-for-strings-with-more-than-one-word Remember to read the official documents. ✌
9th Jan 2019, 11:34 PM
dρlÏ…Ń•ÏlÏ…Ń•
dρlÏ…Ń•ÏlÏ…Ń• - avatar