I've been writing a program that asks the user to input information into a text file and then can pull up information from a certain number of previous workouts (it records fitness progress). I am designing two functions that are supposed to run through the program with a getline statement, compare it to the input by the user and then print the workout until getline recognizes a stop signal (a "|" which serves as the marker for the end of the workout).
It seems to have no real problems but both of the functions have the same error pop up which reads:
no match for 'operator==' in 'std::getline [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((std::basic_istream<char, std::char_traits<char> >&)((std::basic_istream<char, std::char_traits<char> >*)(&cardio))), ((std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)(&cardio_holder))) == "|"'
std::getline returns a reference to the stream object you pass as the first argument. What you probably want to do is to first read the string with getline and then afterwards check the string operator==.