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

Ross Paterson <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.hugs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.