I have got a report from COVERITY tool that the above is not a good usage. I have googled and have found that the char pointer returned, would be invalidated as soon as 'someString' meets its destruction.
Given this, how does one fix this issue?..how to return char pointer accurately?.
Yes. Using std::string might as well do. However, this is a legacy method and I would like to use it as it is..without changing the signature of the method.
So, is there any way to return char pointer without causing any trouble?.