home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3727 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.3 KB  |  42 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!psinntp!panix!os2man
  3. From: os2man@panix.com (Larry Salomon Jr.)
  4. Subject: Re: What's wrong with this?
  5. Message-ID: <1992Jul22.020718.17468@panix.com>
  6. Date: Wed, 22 Jul 1992 02:07:18 GMT
  7. References: <jarman.711695763@ee.ualberta.ca>
  8. Organization: PANIX Public Access Unix, NYC
  9. Lines: 31
  10.  
  11. In <jarman.711695763@ee.ualberta.ca> jarman@ee.ualberta.ca (Andrew Jarman) writes:
  12.  
  13. >I have finally got a chance to start porting some of our work utilities
  14. >to OS/2 using GCC 2.1  A lot of our programs are really simple command
  15. >line utilties used for manipulating data files.  Can someone tell
  16. >me what is wrong with this?  I compile and run it under gcc 2.1, no
  17. >errors in the compilation.  The system does not print any output until
  18. >I type in enough input first, or press ^Z, to end my input stream.
  19.  
  20. >#include <stdio.h>
  21. >#include <stdlib.h>
  22.  
  23. >main() {
  24. >    char buffer[100];
  25.  
  26. >    printf("This is a test\n");
  27. >    scanf("%s", buffer);
  28. >    printf("Buffer = %s\n", buffer);
  29. >}
  30.  
  31. >Is there an ioctl statement I need to use first? This is such a basic
  32. >program that I figure it MUST work.  Any ideas?
  33. >Thanks.
  34.  
  35. Insure that you set output buffering off.  I believe the call is 
  36. setbuf(stdout,NULL) .
  37. -- 
  38. Cheers,
  39. Q
  40. -----------------------------------------------------------------------
  41. "If you still choose not to decide,   | "My other account is in the
  42.