Well its not just one little API function, all the API functions take C style strings.
And if I have to reserve space with C++ strings that kinda defeats the purpose of using it.
Why complicate...
Type: Posts; User: Ducky
Well its not just one little API function, all the API functions take C style strings.
And if I have to reserve space with C++ strings that kinda defeats the purpose of using it.
Why complicate...
Ok, that clears it up. It's just better to forget about C++ with Win32 API.
Since when we have to set the size of a C++ string? I thought that, that was the point of C++ strings (no need to set a size).
Haha, wasn't it the Win32 API that came first? :-)
So I should pass the string to a char* first, that defeats the purpose of using a string.
The inventor of C++ should have thought about Win32 API functions too when he was writing the language.
Win32 API function ReadFile()'s second argument takes an LPVOID.
Is there a way to use a C++ string directly for the second argument?
string strBuf;
ReadFile(h, ...