Hi..
whats the best way to initialize a char* ? i tried using char* p = ""; and it gives segmentation fault at times. not sure how to initialize it.
this is the function where i'm using it. screenReturnValue variable is not getting initialised properly everytime, when i call this method the second time it returns a value which is a concatanation of last value and current value.
char*
generateReturnValue(string screenClassName)
{
char* screenReturnValue = "";
char* ptr = "Ptr";
strcat(screenReturnValue,screenClassName.c_str());
strcat(screenReturnValue,ptr);
return screenReturnValue;
}
thanks