you can use getline()  (see man 3 getline)