PDA

View Full Version : SOLVED QString::fromWCharArray gives strange charracters



newb
28th June 2010, 07:15
Hi..

I have a string named aDrive = "H:/"

i want to convert this string into WCHAR so used like below

WCHAR Drive[4];

aDrive.toWCharArray ( Drive ) ;

when i printed it qDebug ()<<QString::fromWCharArray ( Drive );

it displays like "H:/???"

why i get the starnge charracters at the end..

Thank you for your time

agathiyaa
28th June 2010, 11:55
WCHAR Drive[4]={0}; should solve your problem