tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Address of bug using array notation?


From: Mike Henning
Subject: [Tinycc-devel] Address of bug using array notation?
Date: Fri, 6 Oct 2006 15:18:35 -0700 (PDT)

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? :)


Thanks,
Mike H.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]