Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %module example
- %{
- #define SWIG_FILE_WITH_INIT
- #include <iostream>
- void stdin_to_file()
- {
- char buf[10];
- fscanf(stdin, "%s", buf);
- FILE *f = fopen("stdin.txt", "w");
- fprintf(f, "%s", buf);
- fclose(f);
- }
- void str_to_stdout()
- {
- char buf[] = "foobar";
- fprintf(stdout, "%s", buf);
- }
- %}
- %include <std_iostream.i>
- void stdin_to_file();
- void str_to_stdout();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement