I have a very simple piece of code - but it only returns the right value when I am stepping through it with a debugger. The code is below...
1 2 3 4 5 6
constwchar_t* src = L"This is a wide character string.";
int32_t len = wcslen(src);
wchar_t* dest = newwchar_t[len + 1];
wcsncpy(dest, src, len);
int32_t value = wcsncmp(src, dest, len);
return (value == 0);
I am not doing anything difficult here but if I run it without stepping through it then it returns false. When I step through it, value equals zero and it returns true.