[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Address of bug using array notation?
From: |
Oded Shimon |
Subject: |
Re: [Tinycc-devel] Address of bug using array notation? |
Date: |
Sat, 7 Oct 2006 00:37:06 +0200 |
User-agent: |
Mutt/1.5.11 |
On Fri, Oct 06, 2006 at 03:18:35PM -0700, Mike Henning wrote:
> If I have a number stored in a character array and try
> to casr to an integer it returns the incorrect result
> using array notation.
>
> int i;
> int ii=443221;
> char test[20]
>
> memcpy(test, ii, sizeof(ii));
> i = *(int*)test <--- This works
>
> memcpy(&test[4], ii, sizeof(ii));
> i = *(int*)&test[4] <--- This doesn't work
> i = *(int*)(test+4) <--- This works
>
> Any takers? :)
Hehe
http://lists.gnu.org/archive/html/tinycc-devel/2005-07/msg00068.html
(the very reason i subscribed to this list)
- ods15