If I wanted to write C++ style getline(), how would one know to write it like this?:
Both of the examples you have shown are both C++ not C.
As you have shown there are two different versions of getline(), one that works with a C-string and another version that uses a std::string. Your first snippet is using a C-string (an array of char terminated by the end of string character ('\0')) and your second snippet is using a C++ std::string.