home *** CD-ROM | disk | FTP | other *** search
- 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
- From: chuck@gte.com (Chuck Hoffman)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Comparing strings 'n stuff...
- Message-ID: <chuck-280892124136@choffman.gte.com>
- Date: 28 Aug 92 16:42:01 GMT
- References: <1992Aug28.134804.9876@sun1x.actc.res.utc.com>
- Sender: news@ceylon.gte.com
- Followup-To: comp.sys.mac.programmer
- Organization: GTE Laboratories
- Lines: 24
-
- In article <1992Aug28.134804.9876@sun1x.actc.res.utc.com>,
- rer@utrcv1.res.utc.com (Rick E Romkey) wrote:
- >
- >
- > I am trying to compare a Str255 with a String which exists
- > in my resource file. I have loaded it in, but I am at a loss
- > as to what to do to compare these two strings to see if they
- > are equivalent.
- >
-
- If you are using THINK C, there are two routines for converting between
- strings of Pascal format (with length byte at the beginning) and C format
- (with null character at the end). They are "PtoCstr" and "CtoPstr". If
- you get both strings into C format, then you can use the C library routine
- "strncmp" to compare them, even if they are of dissimilar length.
-
- Chuck Hoffman
- chuck@gte.com
- GTE Laboratories, Waltham, Massachusetts, USA
- (617) 466-2131
- =====================================
- I'm not sure why we're here, but I am sure that while we're here we're
- supposed to help each other.
- =====================================
-