C/C++ Char Pointer Crash

前端 未结 7 449
甜味超标
甜味超标 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.

    0 讨论(0)
提交回复
热议问题