I have one array of WCHAR is like this
WCHAR Path[256];
So I'm passing this array in my function getpath(Path)
and It's filling the value in path like this:
//device/systemName/
So I want to get only device from above string.
My code is here:
WCHAR *pDevName;
int i = 0;
int j = 0;
while(Path[i] != NULL){
if(0 ==(wcscmp(Path, L"/")))
{
//i = i + 2;
++i;
continue;
}
else
{
pDevName[j] = Path[i];
++i;
++j;
if (0 == wcscmp(Path, L"/")){
break;
}
}
My code is getting compiled but it's not returning for me device from WCHAR array. It's returning //devicename/systemName/
, which is coming from pDevName
.
I have doubt over my comparison on wcscmp()
. So my question is how to compare / with remaining wchar array value.