scanf read line

C
scanf(" %[^\n]",line);
Source

Also in C: