Skip to content

Instantly share code, notes, and snippets.

@jonte
Created February 6, 2011 22:02
Show Gist options
  • Save jonte/813762 to your computer and use it in GitHub Desktop.
Save jonte/813762 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(){
FILE *fpipe;
char *command="echo \"2+2.\" | erl_call -sname ggs -e";
char line[256];
if ( !(fpipe = (FILE*)popen(command,"r")) ){
perror("Problems with the pipe");
exit(1);
}
while ( fgets( line, sizeof line, fpipe)){
puts(line);
}
pclose(fpipe);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment