home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / os2 / programm / 4895 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.8 KB  |  52 lines

  1. Path: sparky!uunet!gatech!rutgers!ub!acsu.buffalo.edu!ubvmsb.cc.buffalo.edu!oistony
  2. From: oistony@ubvmsb.cc.buffalo.edu (Anthony M. Petro)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: novice gcc/programming question
  5. Message-ID: <BuFo2G.9Bs@acsu.buffalo.edu>
  6. Date: 11 Sep 92 21:37:00 GMT
  7. Sender: nntp@acsu.buffalo.edu
  8. Organization: University at Buffalo
  9. Lines: 39
  10. News-Software: VAX/VMS VNEWS 1.41
  11. Nntp-Posting-Host: ubvmsb.cc.buffalo.edu
  12.  
  13. i installed gcc 2.2.2 on my system, but have been having minor 
  14. difficulties in getting a very simple portion of my very simple 
  15. program to work.
  16.  
  17. point of the program: prompt user for a filename, open file and read 
  18. in a bunch of ints, bubble sort them, and print the results to the 
  19. screen.
  20.  
  21. but... (code snippet follows)
  22.  
  23. main()
  24. {
  25.         int num[100], count, test;
  26.         char datafile[15];
  27.         FILE *infilep;
  28.  
  29.         printf("\n%s","Please enter the name of the data file:\n");
  30.         scanf("%s",datafile);
  31. ..
  32.  
  33. NOTHING i do will get the finished product to actually print the 
  34. prompt string BEFORE i enter the file name.  prompts are pretty 
  35. useless if they're not displayed.
  36.  
  37. as i said, the program works fine functionally, i just don't see the 
  38. "Please enter..." prompt until after i enter the filename.  btw, i 
  39. compiled the same program w/ gcc under unix (on a sun 4) and it works 
  40. properly.  hence i find fault, somehow, with the os2 port.
  41.  
  42. question: am i sane?  i consider the fact that it works w/o adjustment 
  43. on another machine pretty solid proof but maybe i'm overlooking 
  44. something.  
  45.  
  46. anthony m. petro   "beethoven"    i can say what i want; i'm just an undergrad
  47. oistony@UBVMSD.BITNET             "frame by frame,
  48. petro@eng.buffalo.edu              death by drowning,
  49. petro@sun.acsu.buffalo.edu         in your own
  50.                                    in your own...
  51.                                    analysis..."
  52.