home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!srvr1.engin.umich.edu!saimiri.primate.wisc.edu!ames!kronos.arc.nasa.gov!joshr
- From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
- Subject: Re: &StringPtr -vs- StringPtr?
- Message-ID: <1993Jan22.200837.13294@kronos.arc.nasa.gov>
- Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
- Nntp-Posting-Host: mcc2.arc.nasa.gov
- Organization: NASA/ARC Information Sciences Division
- References: <1993Jan22.165348.11313@novell.com>
- Date: Fri, 22 Jan 1993 20:08:37 GMT
- Lines: 60
-
- In article <1993Jan22.165348.11313@novell.com> damurphy@wc.novell.com (Duane Murphy) writes:
- >
- >I have received some code (from a source to remain anonyumous) that is
- >supposed to work with MPW and Think C. The MPW compiler says nothing,
- >but Think C whines about types not matching. Here is where the problem
- >is:
- >
- > Str255 msg1, msg2;
- >
- >... // code deleted
- >
- > GetIndString(&msg1, errResID, errStringIndex);
- >
- >The problem is &msg1. The prototype for GetIndString is:
- >(from ToolUtils.h)
- >
- >pascal void GetIndString(Str255 theString,short strListID,short index);
- >
- >I have changed the call to:
- >
- > GetIndString(msg1, errResID, errStringIndex);
-
-
- Try someting like this (it works for me)
- GetIndString((ConstStr255Param) msg1, ......
-
- Also, note that because msg1 is technically an array of chars,
- msg1 is the address of the first element, and &msg1 has no real
- meaning (thoug usually is interpreted as just &msg1[0], or msg1).
-
- Sorry, I realize you got this.
-
- >
- >which seems (to me) to match to prototype better.
- >
- >Who is right (according to ANSI)? Is MPW being a slacker? Is Think C
- >being picky?
-
- Think C is being picky.
- I would say that if you passed msg1 (not &msg1), it SHOULD accept it.
- I believe I usually must cast in that situation as well, though.
-
-
- >
- >
- >Thanks,
- >...Duane
- >
- > +------------------------+--------------------------------------------+
- > | Duane Murphy | My opinions are mine, mine, and only mine; |
- > | damurphy@wc.novell.com | Except when they are also yours. |
- > | Macintosh Software QA | |
- > +------------------------+--------------------------------------------+
-
-
- --
- ----------------------------------
- #include <std/disclaimer.h> Josh Rabinowitz, Mac TCL programmer
- joshr@kronos.arc.nasa.gov
- "Me lost my cookie at the disco." -- Cookie Monster
-