Hi,
Please help me on this
Here i want to save the converted data into new pointers. But everytime the data is overwriting with most recent data.
Please check my code
TCHAR nameBuffer[256]; //Globally Declared
void Caller()
{
TCHAR* ptszSecondInFile= QStringToTCharBuffer(userName);
TCHAR* ptszOutFile=QStringToTCharBuffer(Destinationfilename);
}
TCHAR *dllmerge::QStringToTCharBuffer( QString buffer )
{
memset(nameBuffer, 0, sizeof(nameBuffer));
#if UNICODE
_tcscpy_s(nameBuffer, _countof(nameBuffer), buffer.toUtf8());
#else
_tcscpy_s(nameBuffer, _countof(nameBuffer), buffer.toLocal8Bit());
#endif
_tprintf( _T( "nameBuffer %s\n" ), nameBuffer );
return nameBuffer;
}
I am gettting ptszSecondInFile and ptszOutFile both same answer.
Is it possible to do with TCHAR* nameBuffer[256];