home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14671 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.5 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!mips!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!transfer!ceylon!choffman.gte.com!user
  2. From: chuck@gte.com (Chuck Hoffman)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Comparing strings 'n stuff...
  5. Message-ID: <chuck-280892124136@choffman.gte.com>
  6. Date: 28 Aug 92 16:42:01 GMT
  7. References: <1992Aug28.134804.9876@sun1x.actc.res.utc.com>
  8. Sender: news@ceylon.gte.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: GTE Laboratories
  11. Lines: 24
  12.  
  13. In article <1992Aug28.134804.9876@sun1x.actc.res.utc.com>,
  14. rer@utrcv1.res.utc.com (Rick E Romkey) wrote:
  15. > I am trying to compare a Str255 with a String which exists
  16. > in my resource file.  I have loaded it in, but I am at a loss
  17. > as to what to do to compare these two strings to see if they
  18. > are equivalent.
  19.  
  20. If you are using THINK C, there are two routines for converting between
  21. strings of Pascal format (with length byte at the beginning) and C format
  22. (with null character at the end).  They are "PtoCstr" and "CtoPstr".  If
  23. you get both strings into C format, then you can use the C library routine
  24. "strncmp" to compare them, even if they are of dissimilar length.
  25.  
  26. Chuck Hoffman
  27. chuck@gte.com
  28. GTE Laboratories, Waltham, Massachusetts, USA
  29. (617) 466-2131
  30. =====================================
  31. I'm not sure why we're here, but I am sure that while we're here we're
  32. supposed to help each other.
  33. =====================================
  34.