Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!sei!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!pt.cs.cmu.edu!rover.ri.cmu.edu!mkb From: mkb@rover.ri.cmu.edu (Mike Blackwell) Newsgroups: comp.sys.mac.programmer Subject: P-strings in MPW C++ Keywords: C++ Message-ID: <12035@pt.cs.cmu.edu> Date: 20 Feb 91 19:16:12 GMT Reply-To: mkb@rover.ri.cmu.edu (Mike Blackwell) Organization: Carnegie-Mellon University, CS/RI Lines: 15 In MPW C++, the following code snippet compiles fine: #include char foo[10]; strcpy(foo, "bar"); but if I replace "bar" with "\pbar", I get a bad argument error, stating that a const char * was expected, but it got an unsigned char [5] instead. Why is this? I know I can coerce it with a (char *)"\pbar", but that's ugly. What I really want is something like: Str255 foo; strcpy(foo, "\pbar"); but again, CFront doesn't like a Str255 in place of a char *. Why not? Is there a better way to achieve the same effect without type coercing both arguments? Thanks for any insight... Mike Blackwell mkb@rover.ri.cmu.edu