Path: utzoo!mnetor!tmsoft!torsqnt!hybrid!scifi!bywater!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: Problem in opening COM1: Keywords: msdos COM1 serial port Message-ID: <610@taumet.com> Date: 21 Feb 91 15:55:39 GMT References: <5205@vela.acs.oakland.edu> Organization: Taumetric Corporation, San Diego Lines: 27 panguyen@vela.acs.oakland.edu (panguyen) writes: >#include >main() >{ > fopen( "COM1", "r+" ); > fprintf( "CHN %d \r", 3 ); >} >This will cough back at me with the following errors, > Write fault error writing device COM1 > Abort, Retry, Ignore ? Apart from other help already posted, please note that fprintf() requires a first parameter of type FILE*, usually the result of an fopen() call. So your example at minimum should have looked more like this: FILE *com1 = fopen( "COM1", "r+" ); if( ! com1 ) ... error: can't open COM1 fprintf(com1, "CHN %d \r", 3 ); This is apart from any machine-specific problems there may be with COM1. -- Steve Clamage, TauMetric Corp, steve@taumet.com