-
WriteConsole
I'm going to be writing a console game in which I need to print out chars very quickly. The funtion I destined for this task is WriteConsole(), because I found it to be the fastest. My question is- there is one parameter in that function that points to a value and writes in how many chars were written. I have no use for this feature. Is it wrong to have it point to a useless, global vaiable every time? Passing NULL causes an error.
Code:
BOOL WriteConsole(
HANDLE hConsoleOutput,
const VOID* lpBuffer,
DWORD nNumberOfCharsToWrite,
LPDWORD lpNumberOfCharsWritten,
LPVOID lpReserved
);
lpNumberOfCharsWritten
[out] Pointer to a variable that receives the number of TCHARs actually written.
-
Re: WriteConsole
I always have it pointing to a dummy variable....cant hurt if you dont care about the success of the function call
-
If you want to output a number of the same character, use FillConsoleOutputCharacter(), look it up, or it is covered in part 2 of my tutorial here.