cvs commit: hugs98/src errors.c script.c hugs98/src/winhugs General.c IORemap.c Winhugs.h

Ross Paterson ross at soi.city.ac.uk
Wed Oct 5 06:36:51 EDT 2005


On Wed, Oct 05, 2005 at 11:19:24AM +0100, Neil Mitchell wrote:
> I noticed you changed:
> 
> FileName = &FileName[5]
> 
> to
> 
> FileName += 5
> 
> I realise on some bad C compilers the second one may be more
> efficient, but the first has the advantage that when converting from
> ASCII to Unicode it still works, whereas the second one corrupts the
> string. Because of this, I always write using the first one.

I believe that in C the two are completely equivalent.  (Is that not so
in VC++?) I just have a prejudice that &arr[n] should be used when one
means a pointer to a single element, and arr+n when one wants a pointer
to the array from that position (even though in C they're the same thing).

BTW, I also changed the argument to itoa(); hope that's OK.



More information about the Cvs-hugs mailing list