Skip to content

Instantly share code, notes, and snippets.

@erikroyall
Created October 3, 2016 16:06
Show Gist options
  • Save erikroyall/64ea7432342a9b30ee88faa7ee25f960 to your computer and use it in GitHub Desktop.
Save erikroyall/64ea7432342a9b30ee88faa7ee25f960 to your computer and use it in GitHub Desktop.
`echo "potato" | ./not` after you compile
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int inp;
fprintf(stdout, "not ");
while (1) {
inp = getchar();
if (inp == EOF) break;
fprintf(stdout, "%c", inp);
}
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment