C ++ fgets equivalent
What is the C ++ equivalent of a C function fgets
?
I have looked getline
from ifstream
, but when it comes to the end-of-line character '\n'
, it terminates and discards it. I'm looking for a function that just ends with an end-of-line character but adds an end-of-line character to the array char
.
+2
a source to share