Thread View: comp.os.os2.programmer
2 messages
2 total messages
Started by Andrew Jarman
Tue, 21 Jul 1992 05:16
What's wrong with this?
Author: Andrew Jarman
Date: Tue, 21 Jul 1992 05:16
Date: Tue, 21 Jul 1992 05:16
27 lines
1518 bytes
1518 bytes
I have finally got a chance to start porting some of our work utilities
to OS/2 using GCC 2.1 A lot of our programs are really simple command
line utilties used for manipulating data files. Can someone tell
me what is wrong with this? I compile and run it under gcc 2.1, no
errors in the compilation. The system does not print any output until
I type in enough input first, or press ^Z, to end my input stream.
#include <stdio.h>
#include <stdlib.h>
main() {
char buffer[100];
printf("This is a test\n");
scanf("%s", buffer);
printf("Buffer = %s\n", buffer);
}
Is there an ioctl statement I need to use first? This is such a basic
program that I figure it MUST work. Any ideas?
Thanks.
--
/***************************************************************************\
| Andrew Jarman | Computer Engineering |
| jarman@bode.ee.ualberta.ca | University of Alberta, Canada |
\***************************************************************************/
Re: What's wrong with this?
Author: Larry Salomon Jr.
Date: Wed, 22 Jul 1992 02:07
Date: Wed, 22 Jul 1992 02:07
31 lines
1423 bytes
1423 bytes
In <jarman.711695763@ee.ualberta.ca> jarman@ee.ualberta.ca (Andrew Jarman) writes:
>I have finally got a chance to start porting some of our work utilities
>to OS/2 using GCC 2.1 A lot of our programs are really simple command
>line utilties used for manipulating data files. Can someone tell
>me what is wrong with this? I compile and run it under gcc 2.1, no
>errors in the compilation. The system does not print any output until
>I type in enough input first, or press ^Z, to end my input stream.
>#include <stdio.h>
>#include <stdlib.h>
>main() {
> char buffer[100];
> printf("This is a test\n");
> scanf("%s", buffer);
> printf("Buffer = %s\n", buffer);
>}
>Is there an ioctl statement I need to use first? This is such a basic
>program that I figure it MUST work. Any ideas?
>Thanks.
Insure that you set output buffering off. I believe the call is
setbuf(stdout,NULL) .
--
Cheers,
Q
-----------------------------------------------------------------------
"If you still choose not to decide, | "My other account is in the
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads