I am getting an invalid pointer error when I call the below function. Why is this happening?
void Get(const char* value)
{
string st("testing string");
string val = st.substr(1, st.length());
value = val.c_str();
}
int main()
{
const char *val = NULL;
GetVal(val);
cout<<val;
}
The objective is to return the substring.