Say you have “methods”
int Read(...)
{
unsigned char Byte = 0;
if(!ReadFile(.., &byte, 1,...))
return -1;
return Byte;
}
int ReadBlock(LPWSTR buffer, int cchBuffer ...)
{
int c = 0;
int cnt = 0;
do
{
if( (c=Read(...)) != -1 )
buffer[num++] = c; // Here.
} while( num < ccBuffer );
return cnt;
}
What is the proper way to get that int correctly to WCHAR?
After reading When should static_cast, dynamic_cast and reinterpret_cast be used?, I realize it was my lack of knowledge about casting that triggered me to ask this question.