Path: utzoo!attcan!uunet!cs.utexas.edu!usc!sdd.hp.com!wuarchive!psuvax1!psuvm!cxt105 From: CXT105@psuvm.psu.edu (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Re: Quick Question - Strings Message-ID: <90347.101213CXT105@psuvm.psu.edu> Date: 13 Dec 90 15:12:13 GMT References: <32027.276537C6@stjhmc.fidonet.org> Organization: Penn State University Lines: 23 Careful here: remember, the Mac expects to see Pascal-style strings most of the time (for example, when using DrawString() to write them into a window) instead of C-style strings. So, you might have to do something like strcpy(test, "\pHello"); /* \p indicates a Pascal string */ instead of strcpy(test, "Hello"); /* vanilla C string */ This is what THINK C uses to allow Pascal-string literals in the source code; I don't know if MPW uses the same convention. (BTW, if you don't know, C strings have a (char) 0 immediately after the last char in the string, as a termination mark; Pascal strings use the first byte as a length indicator -- thus, they can't be more than 255 characters of actual text.) ------- Christopher Tate | etaT rehpotsirhC Bitnet: cxt105@psuvm | mvusp@501txc :tentiB Uucp: ...!psuvax1!psuvm.bitnet!cxt105 | 501txc!tentib.mvusp!1xavusp!... :pcuU Internet: cxt105@psuvm.psu.edu | ude.usp.mvusp@501txc :tenretnI