Memory Error with std:ostringstream and -std=c++11? [duplicate]
This question already has an answer here: stringstream, string, and char* conversion confusion 5 answers EDIT : Thanks to everyone who pointed out the problem, and that it was discussed on Stack Overflow. I cast the last close vote myself. A related question: neither CPP Reference on ostringstream or ostringstream::str state its a temporary. How did so many people know? Or is there different documentation I should have consulted? I'm having a lot of trouble with memory errors under Debian 7.3 (x64) with GCC 4.7.2, -std=c++11 and std::ostringstream . Its leading to bizaare results like https:/