blub
By: Console | Date: Oct 25 2009 14:33 | Format: C++ | Expires: never | Size: 563 B | Hits: 889
- #include <windows.h>
- #include <cstdlib>
- #include <iostream>
- #include <conio.h>
- #include <stdio.h>
- #include <io.h> /* _open_osfhandle */
- #include <fcntl.h> /* for _O_TEXT and _O_BINARY */
- void Console()
- {
- int hCrtIn, hCrtOut;
- FILE *conIn, *conOut;
- AllocConsole();
- hCrtIn = _open_osfhandle ((intptr_t) GetStdHandle(STD_INPUT_HANDLE), _O_TEXT);
- hCrtOut = _open_osfhandle ((intptr_t) GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
- conIn = _fdopen( hCrtIn, "r" );
- conOut = _fdopen( hCrtOut, "w" );
- *stdin = *conIn;
- *stdout = *conOut;
- }
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago