Reputation: 179
In C, I get a segfault while doing
const wchar_t *id = L"{{content}}\0";
wprintf(L"%s\n", wcslen(id));
I don't understand what's wrong here... Can someone enlighten me?
Upvotes: 0
Views: 212
Reputation: 67835
You dereference the pointer converted from size_t, and wprintf expects the pointer for the %s . Use %zu to display the length.
Upvotes: 3