C/C++ Char Pointer Crash

前端 未结 7 479
甜味超标
甜味超标 2020-12-19 17:42

Let\'s say that a function which returns a fixed ‘random text’ string is written like

char *Function1()
{ 
return “Some text”;
}

then the p

7条回答
  •  臣服心动
    2020-12-19 18:28

    You can use static char string for return value, but you never use it. It's just like access violation error. The behavior of it is not defined in c++ Standard.

提交回复
热议问题