how to read space separated words in c

C
scanf("%[^\n]%*c", ref_string); 
Source

Also in C: