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

Neil Mitchell ndmitchell at gmail.com
Wed Oct 5 06:45:27 EDT 2005


> 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).

As far as I was aware, if they operate on char*, they are equivalent,
since sizeof(char) = 1. However, if the code is ever switched to using
unicode characters, which makes it a short*, then b = &b[5] is
equivalent to b += 5 * sizeof(short), which is b += 10. For the moment
they are the same, but since unicode support is a distinct possibility
in the future its best to keep it as easy as we can.

> BTW, I also changed the argument to itoa(); hope that's OK.
Fine, its not a problem now, I was just making everyone aware that
unicode adds certain concerns.

Thanks

Neil


More information about the Cvs-hugs mailing list