I tried to use getline, but it only works with string, not char.
There are two getline() functions one that works with std::string one that works with C-strings you need to use the proper version depending on whether you're using C-strings or std::string.