我在C++中有一个函数,我想返回一个字符串.我尝试过几种方法但是却出错了.我已经尝试过C#返回方式"......"; return myString; 但每次都会出错.
编辑:
TestConsoleApp2.exe中0x100c1486(DGGGGG.dll)的未处理异常:0xC0000005:访问冲突写入位置0x7a0dcc30.
std::string methodReturningString()
{
std::string something = "Hello ";
something += "world!";
return something;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
153 次 |
| 最近记录: |