Pregunta

A bit new to c++ and attempting to concatenate variables of differing types and literal strings together to create a formatted output later, however I keep getting an error once I add in any literal strings with quotes such as "This in quotes" etc, below is my code of how I attempted to do it, any help will go a long way

 string format;

 std::stringstream stream;
 stream << "Work Ticket # "<< workTicket << " "<< clientNumber << "(" <<labDay << "/"<     labMonth << "/"<< labYear <<") : "<< labDesc;
 format = stream.str();
¿Fue útil?

Solución

There appears to be a typo in your code:

...labDay << "/"<     labMonth...

should read

...labDay << "/" << labMonth...

Whats's your exact error message?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top