jeudi 20 octobre 2016

No able to reinitialize the WCHAR[] array once it gets the initialized

While(1)
{
WCHAR wcImageName[80];
if ( pxmlNameTag->GetData(wcImageName, wcslen(wcImageName)) )
{
    if ( !wcscmp(wcImageName, String2) )
       {
           Printf("String matched");
           break;
       }
       else
       {
           Printf("In else");
       }
 }
 else
 {
       Printf("Failed to get the data");
 }
}
}

I am iterating the loop till i got the matching string. GetData is used to get the string into wcImageName. 1st time a am able to get the data into wcImageName and it is compared with string2. If not matched loop iterate 2nd time. i am declaring wcImageName again but GetData is not able to copy the data into wcImageName. because it is initialized. i have tried to initialize it with L'\0' but the same result.

Aucun commentaire:

Enregistrer un commentaire