Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!julius.cs.uiuc.edu!rpi!uupsi!sunic!fuug!clinet!maa From: maa@clinet.fi (Miika Asunta) Newsgroups: comp.sys.mac.programmer Subject: Re: Str255 in C Message-ID: <1991Jan16.161856.17315@clinet.fi> Date: 16 Jan 91 16:18:56 GMT References: <1991Jan13.210327.9613@ux1.cso.uiuc.edu> <1991Jan14.142512.24220@clinet.fi> <1991Jan15.180350.3497@ux1.cso.uiuc.edu> Organization: City Lines Oy, Helsinki, Finland Lines: 26 ml27192@uxa.cso.uiuc.edu (lanett mark) writes: >maa@clinet.fi (Miika Asunta) writes: >>2. Instead of using strcopy, which is quite slow, use Toolbox routine >>BlockMove, which is extremely fast: >>{ >>Str255 a="\pThis is a test", b; >>BlockMove(a,b,a[1]+1); >>} >I think you meant a[0]+1. This also works for strncpy (i.e. >strncpy (a, b, b[0]+1) // b must be a pascal string Yeah. Sorry the typing error... but again... why to use strncpy because BlockMove() is much faster? And should the a[0] be coerced somehow in Think C. I haven't had any problems with this? -- ************************************************************************* * Miika Asunta * Double Basist * * internet: maa@clinet.fi * Macintosh Programmer * * UUCP: mcsun!fuug!clinet!maa * *