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