From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Wed, 16 Jun 2010 11:11:09 +0200 Message-ID: From: hugo rivera To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: [9fans] portability question Topicbox-Message-UUID: 343083fc-ead6-11e9-9d60-3106f5b1d025 Can someone clarify why the program included outputs 'AB000000' (as I expect) on 32 bit systems and 'FFFFFFFFAB000000' on 64 bit systems? where all those 1's came from? what's the portable way of doing this? sorry for newbie questions like this. unsigned long l; unsigned char c; l = 0L; c = 0xAB; l |= c << 24; printf("%lX\n", l); -- Hugo