Been playing with Orca C... this doesn't print anything... fprintf(stdout,"Hello there"); even though the manual says it should...so I tried this: freopen(".CONSOLE","w",stdout); fprintf(stdout,"Hello there"); Still didn't work... only the standard print command works... printf("Hello there"); Am I doing something wrong? In article , "Terry Olsen" wrote: > Been playing with Orca C... this doesn't print anything... > > fprintf(stdout,"Hello there"); > > even though the manual says it should...so I tried this: > > freopen(".CONSOLE","w",stdout); > fprintf(stdout,"Hello there"); > > Still didn't work... > > only the standard print command works... > > printf("Hello there"); > > Am I doing something wrong? > > There isn't a \n on the line, which in the C language could mean that the buffer doesn't flush. That, I do not believe, is a problem with the ORCA/C implementation of the language. (C language side note: normally in the C language if you want the cursor to remain on the same line as the output you'd use a fflush(stdout); after the printf(...); to ensure that the line actually prints (portably across all implementations). It works just fine on my system: #include int main(void) { fprintf(stdout,"Hello there\n"); return 0; } #run test.c keep=t ORCA/C 2.1.0 Including :Mr.Boot:ORCA:LIBRARIES:ORCACDefs:stdio.h Compiling main 0 errors found. Link Editor 2.0.3 Pass 1: .................................................... Pass 2: .................................................... There is 1 segment, for a length of $000015C3 bytes. Hello There # Which version of ORCA/C are you using? Paste the smallest version of your program that exhibits the behavior. Maybe there is a typo or something you aren't seeing. Sometimes a second set of eyes can find the problem easier. By the way, are you on an emulator or on a real IIgs? My screen says: Orca/Shell 1.2.1 Orca/C Disk Version 1.2 Release Date: 15 March 1991 Are you game for updating me to the latest version? The following code works when compiled on my PC, but doesn't print anything when compiled using my version of Orca/C, either on my real GS or in the emulator (Kegs) ------------------ Begin Code --------------------------------------- /* This program prints out a listing with line numbers */ #include void do_heading(char *filename); int line, page; int main( int argv, char *argc[] ) { char buffer[256]; FILE *fp; if( argv < 2) { fprintf(stderr, "\nProper Usage is: " ); fprintf(stderr, "printit filename\n" ); return(1); } if (( fp = fopen( argc[1], "r" )) == NULL ) { fprintf( stderr, "Error opening file, %s!", argc[1] ); return(1); } page = 0; line = 1; do_heading( argc[1]); while( fgets( buffer, 256, fp ) != NULL ) { if( line % 55 == 0 ) do_heading( argc[1] ); fprintf( stdout, "%4d:\t%s", line++, buffer); } fprintf( stdout, "\f" ); fclose(fp); return(0); } void do_heading( char *filename ) { page++; if ( page > 1) fprintf( stdout, "\f" ); fprintf( stdout, "Page: %d, %s\n", page, filename ); } --------------- End Code -------------------------------------- > > Which version of ORCA/C are you using? > > Paste the smallest version of your program that exhibits the behavior. > Maybe there is a typo or something you aren't seeing. Sometimes a second > set of eyes can find the problem easier. > > By the way, are you on an emulator or on a real IIgs?