home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18301 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  985 b 

  1. Path: sparky!uunet!ogicse!reed!bowman
  2. From: bowman@reed.edu (BoBoRamDos)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: A simple question from a beginner.
  5. Keywords: simple C youKnowTheAnswer help
  6. Message-ID: <1992Nov12.093624.13509@reed.edu>
  7. Date: 12 Nov 92 09:36:24 GMT
  8. Article-I.D.: reed.1992Nov12.093624.13509
  9. References: <BxLGCH.AAt@world.std.com>
  10. Organization: Reed College, Portland, OR
  11. Lines: 18
  12.  
  13. In article <BxLGCH.AAt@world.std.com> djk@world.std.com (Dan J Keldsen) writes:
  14. >    char    line[ MAX_LINE_LENGTH ], *charPtr, inWord;
  15.                                           ^^^^^^^
  16. Here you've defined `charPtr` correctly as a pointer to a char,
  17.  
  18. >                printf( "%c", charPtr );
  19.                                               ^^^^^^^
  20. but you've passed printf the pointer, when it expects the actual char itself;
  21. it should be:
  22.  
  23. printf( "%c", *charPtr);
  24.  
  25. Your code tells printf to print the ascii equivalent of the highest byte of
  26. the address pointed too!
  27.  
  28. cheers,
  29. bobo
  30. bowman@reed.edu
  31.