Skip to content

Instantly share code, notes, and snippets.

@emiel
Created December 6, 2012 21:49
Show Gist options
  • Save emiel/4228813 to your computer and use it in GitHub Desktop.
Save emiel/4228813 to your computer and use it in GitHub Desktop.
Simple stdin to stdout (through char buffer)
#include <iostream>
int main(int argc, char *argv[])
{
char buf[4096];
while (std::cin.good()) {
std::cin.read(buf, sizeof(buf));
std::cout.write(buf, std::cin.gcount());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment