B
bine
Sorry, I found a lot of old stuff, even kind of flamewars about
good+bad style whatsoever..
I simply want any hint that works!
I try to migrate older stuff from NT and newer stuff from Linux/AIX to
run on Windows2003 as well. I use the
Open Watcom C32 Optimizing Compiler Version 1.3
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
I simply want some lines to be printed to stdout directly, like a
simple hello.c consisting of basically
printf("my text\n");
This is only printed when I call the programm with a redirection
("hello | tee x" or "hello > x"). The problem is mentioned a lot here
in older comp.* messages. But all the "soultions" I found+tried didn't
work as well.
I tried alternatively:
fflush(stdout);
getch();
getchar();
AFTER the printf, and
setvbuf(stdout,NULL,_IONBF,0);
BEFORE that line
and even
fprintf(stderr,"my text\n");
because I read somewhere stderr would never be buffered...?
So if there is someone with the patience to explain what to do I could
stick to watcom. Otherwise I'd have to throw it away and look for
something else...
Thanks a lot,
bine
good+bad style whatsoever..
I simply want any hint that works!
I try to migrate older stuff from NT and newer stuff from Linux/AIX to
run on Windows2003 as well. I use the
Open Watcom C32 Optimizing Compiler Version 1.3
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
I simply want some lines to be printed to stdout directly, like a
simple hello.c consisting of basically
printf("my text\n");
This is only printed when I call the programm with a redirection
("hello | tee x" or "hello > x"). The problem is mentioned a lot here
in older comp.* messages. But all the "soultions" I found+tried didn't
work as well.
I tried alternatively:
fflush(stdout);
getch();
getchar();
AFTER the printf, and
setvbuf(stdout,NULL,_IONBF,0);
BEFORE that line
and even
fprintf(stderr,"my text\n");
because I read somewhere stderr would never be buffered...?
So if there is someone with the patience to explain what to do I could
stick to watcom. Otherwise I'd have to throw it away and look for
something else...
Thanks a lot,
bine