这是明确定义的行为吗?
const char* p = (std::string("Hello") + std::string("World")).c_str();
std::cout << p;
Run Code Online (Sandbox Code Playgroud)
我不确定.原因是什么?
这会崩溃:
try
{
if(1)
throw;
}
catch(...)
{
printf("hi");
}
Run Code Online (Sandbox Code Playgroud)
我以为我能做到,但我猜不是.当您不需要任何信息时,正确的投掷方式是什么?