Object allocation in C++
- by Poiuyt
char *myfunc() {
char *temp = "string";
return temp;
}
In this piece of code, where does the allocation of the object pointed to by temp happen and what would be its scope?
Is this function a valid way to return a char* pointer?