Skip to content
Advertisement

Tag: getline

how does getline read only up to a newline without seeking?

I’m imagining reading byte by byte would be very inefficient, but reading in bulks would almost always read more than needed, requiring to store the rest of the read input in a global context for all subsequent read operations to find. What am I missing? Answer The prototype is: So it’s clearly using FILE, which is already buffered. So reading

Advertisement