i'm learning c++ and want to know if there is a way to target all systems in one method when i want to write directly to the console
i wrote a windows program where I'm using
it works fine. i have 2 questions, what do i do to do that in a way which will work on any system? is that even possible?PHP Code:
int main()
{
// Create Screen Buffer
wchar_t *screen = new wchar_t[nScreenWidth*nScreenHeight];
HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
SetConsoleActiveScreenBuffer(hConsole);
DWORD dwBytesWritten = 0;
...
screen[nScreenWidth * nScreenHeight - 1] = '\0';
SetConsoleTextAttribute(hConsole, 0xaa);
WriteConsoleOutputCharacter(hConsole, screen, nScreenWidth * nScreenHeight, { 0,0 }, &dwBytesWritten);
}
Results 1 to 16 of 16
Threaded View
-
01-27-2019
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)