nametext
is an std::string
but these do not have the stream insertion operator (<<
) like output streams do.
To concatenate strings you can use the append
member function (or its equivalent, +=
, which works in the exact same way) or the +
operator, which creates a new string as a result of concatenating the previous two.