Skip to content

Instantly share code, notes, and snippets.

@elderica

elderica/c.c Secret

Created January 5, 2022 12:44
Show Gist options
  • Save elderica/8ab654f93ab2e9b4d43bdbdbbb1a223b to your computer and use it in GitHub Desktop.
Save elderica/8ab654f93ab2e9b4d43bdbdbbb1a223b to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main(void) {
char buf[100];
scanf("%s", buf);
printf("%s\n", buf);
scanf("%s", buf);
printf("%s\n", buf);
return 0;
}
#lang racket
(define-values (sp out in err)
(subprocess #f #f #f
"/tmp/a.out"
))
(displayln "hello" in)
(flush-output in)
(printf "~a" (port->string out))
(displayln "AAAAAAAA" in)
(flush-output in)
(printf "~a" (port->string out))
(close-input-port out)
(close-output-port in)
(close-input-port err)
(subprocess-wait sp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment