> Maybe I should ask how fgets() works? What rutines does it use?
Whatever the current platform has to offer probably.

Consider the std:: the nice level concrete on which you build your house.

Underneath, there is the whole jaggy mess of the current platform, but you don't need to know about that. In some places it can be quite thin, but in other places it could be much thicker.