I'm trying to compare in my C-program a string and a LPCTSTR.
Here's what i've done so far (the code has been simplified to only what's problematic) :
DWORD main(DWORD ac, LPCTSTR *av)
{
DWORD cpt = 1;
while (++i < ac)
{
if (strcmp(av[i], "value"))
printf("1 : OK\n");
else if (strcmp(av[i], _T("value")))
printf("2 : OK\n");
else if (strcmp(av[i], (LPCTSTR)"value"))
printf("3 : OK\n");
}
return EXIT_SUCCESS;
}
When I execute my program with the first parameter "value", it appears that none of the if
are verified. I tried with strcmp
and lstrcmp
but the results are the same.
Can someone tell me what I'm doing wrong please ?
Thanks.