On Thursday 10 March 2005 16:17, Diego Iastrubni wrote:
> Shlomi Fish wrote:
> >mem[102] = 'c'.
> >
> >>SEGFAULT! the allocated memory is found at memory 100-103. Bad Thazi!
> >
> >No, it's OK so far.
>
> how come? he is refering to memory which is not allocated? lets ignore
> the issue that the amount of allocated memory can be also 20 as someone
> sayd before...
>
Because he was mallocing four bytes for x, and then putting information in
x[0] to x[3].
> >>In real life Linux does 'allow' the execution of this program, as it
> >>printed lines after this point. Can anyone explain?
>
> !?
>
That's what you said.
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
Knuth is not God! It took him two days to build the Roman Empire.
--------------------------------------------------------------------------
Haifa Linux Club Mailing List (http://www.haifux.org)
To unsub send an empty message to [EMAIL PROTECTED]