I have tested this code:

```
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main()
{
    string s1("a"),s2("b");
    const char * s = (s1+s2).c_str();
    printf("%s\n",s);
}

```

It returns "ab".

As far as I know, since `(s1 +s2)` is a temporary object and may disappear somehow (I have no idea about that), then `const char * s` may point to undefined memory and may get dumped.

So is it safe to use the `.c_str()` like that?