home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!reed!bowman
- From: bowman@reed.edu (BoBoRamDos)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: A simple question from a beginner.
- Keywords: simple C youKnowTheAnswer help
- Message-ID: <1992Nov12.093624.13509@reed.edu>
- Date: 12 Nov 92 09:36:24 GMT
- Article-I.D.: reed.1992Nov12.093624.13509
- References: <BxLGCH.AAt@world.std.com>
- Organization: Reed College, Portland, OR
- Lines: 18
-
- In article <BxLGCH.AAt@world.std.com> djk@world.std.com (Dan J Keldsen) writes:
- > char line[ MAX_LINE_LENGTH ], *charPtr, inWord;
- ^^^^^^^
- Here you've defined `charPtr` correctly as a pointer to a char,
-
- > printf( "%c", charPtr );
- ^^^^^^^
- but you've passed printf the pointer, when it expects the actual char itself;
- it should be:
-
- printf( "%c", *charPtr);
-
- Your code tells printf to print the ascii equivalent of the highest byte of
- the address pointed too!
-
- cheers,
- bobo
- bowman@reed.edu
-