Hello.
Until now, I've been using:
--------------//-----------------
char *MyValue = NULL;
MyValue = (char*)malloc(strlen(Another_Value)+1);
strcpy(MyValue,Another_Value);
-------------//------------------
Now, I want to change to the class 'string' (in order to avoid
memory leaks and buffer overflows).
I'm trying with:
------------------//--------------------
using std::string;
string string_MyValue;
string_MyValue = Another_Value
printf("\n string_MyValue = %s",string_MyValue);
-----------------//---------------------
But I do not get anything. Could anybody explain me what I am
doing wrong?
Thank you very much.
Until now, I've been using:
--------------//-----------------
char *MyValue = NULL;
MyValue = (char*)malloc(strlen(Another_Value)+1);
strcpy(MyValue,Another_Value);
-------------//------------------
Now, I want to change to the class 'string' (in order to avoid
memory leaks and buffer overflows).
I'm trying with:
------------------//--------------------
using std::string;
string string_MyValue;
string_MyValue = Another_Value
printf("\n string_MyValue = %s",string_MyValue);
-----------------//---------------------
But I do not get anything. Could anybody explain me what I am
doing wrong?
Thank you very much.