This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <windows.h> // Include Windows API | |
| // Debug print toggle, comment this to disable debug print statements | |
| #define DEBUG_PRINT | |
| // Function to write a string to the console | |
| void write_to_console(const char* str, int length) { | |
| HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); | |
| DWORD written; | |
| WriteConsoleA(hConsole, str, length, &written, NULL); |