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 _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel