scanf | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson


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. Remember to read the official documents. ✌️
9th Jan 2019, 11:34 PM
dρlυѕρlυѕ - avatar