Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] For C Experts

2006-03-30 by David Hawkins

dsidlauskas1 wrote:
> Consider the following code:
> 
> ============================
> char buf[]={1,2,3,4,5,6,7,8};
> int *ip, x[4];
> 
> for (i=0; i<4; i++)
>     {
>     ip = (int *)&buf[i];
>     x[4]  = *ip;
>     }

Er, given the fact that x is of length 4,
the statement x[4] = *ip is actually out-of-bounds.

Dave

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.