You will love this!
You can redirect stdout to a virtual console file using freopen() like so:
freopen("CONOUT$", "w", stdout);
Redirecting the console to stdin works via the CONIN$ virtual file.
This, of course, does not work with the standard Gamestudio printf(), because standard gamestudio is stupid and doesn't actually ever output to stdout. So, here is the amazing workaround: Shadow printf so that it actually fprintf() with stdout as argument! Cool, but, Lite-C does not support variadic macros and one of the great things about printf() is that you can put a format string in there and you probably do that and don't want to change your call sites. If you expect some genius solution now, sorry, you are totally out of luck. Here is how to write the basic macro though:
#define elide_arg (0)
#define pack_args1(arg0) arg0
#define pack_args2(arg0, arg1) arg0, arg1
#define pack_args3(arg0, arg1, arg2) arg0, arg1, arg2
#define printf(format, args) fprintf(stdout, format, args)
And your call sites would need to change like this:
// Old
printf("Hello World");
printf("Hello %s, %d", "world", 42);
// New
printf("Hello World", elide_arg);
printf("Hello %s, %d", pack_args2("world", 42));
PS: For Chaos, who prefers Haskell over Lite-C, the way to go is using the
Text.Printf packaged. Printf has the following signature: printf :: PrintfType r => String -> r