Skip to content

Instantly share code, notes, and snippets.

@k-takata
Created October 20, 2020 02:56
Show Gist options
  • Save k-takata/475693ff7b627d08866d4685449edbea to your computer and use it in GitHub Desktop.
Save k-takata/475693ff7b627d08866d4685449edbea to your computer and use it in GitHub Desktop.
#include <windows.h>
int main(int argc, char *argv[])
{
HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
char buf[256];
DWORD cb;
ReadFile(hstdin, buf, sizeof(buf), &cb, NULL);
WriteFile(hstdout, buf, cb, &cb, NULL);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment