Re: UnSigned Long




"Peter Nilsson" <airia@xxxxxxxxxxx> wrote in message
news:1125356275.793597.263220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> manoj1978@xxxxxxxxx wrote:
>> Joriveek wrote:
>> > Hi,
>> >
>> > I want to store myvarz = 3000000000;
>> >
>> > I have declared myvarz as unsigned long; still not taking.
>>
>> #include <stdio.h>
>>
>> int main(void)
>> {
>> unsigned int myvarz = 3000000000;
>> printf("%u\n",myvarz);
>> return 0;
>> }
>> This is working in msvc++ 6.0 and gcc.
>
> It should 'work' on any implementation, but may print values
> like 24064 since unsigned int is not required to have more than
> 16 value bits.

Note that the OP indicated he's using type 'unsigned long',
not 'unsigned int'. 'unsigned long' must contain at least
32 bits.

-Mike



.



Relevant Pages

  • [PATCH] get rid if __cpuinit and __cpuexit
    ... unsigned long action, void *hcpu) ... unsigned int cpu = hcpu; ... -static int __cpuinit ... __cpu_up(unsigned int cpu) ...
    (Linux-Kernel)
  • [PATCH 8/9] irq-remove: driver trivial
    ... unsigned int i; ... unsigned int handled = 0; ... struct ata_port *ap; ... Read the interrupt register and process for the devices that have them pending. ...
    (Linux-Kernel)
  • [RFC/PATCH] Winbond CIR driver for the WPCD376I chip (ACPI/PNP id WEC1022)
    ... The driver currently supports receiving IR commands and wake from sleep/power-off. ... The input syscalls all seem to use an int for the scancode (which will be at least 32 bits on any platform which has ... unsigned int last_keycode; ... goto set_timer; ...
    (Linux-Kernel)
  • Re: 2.6.26-rc2 hosed X?
    ... int new); ... struct pci_controller *hose; ... * vblank events since the system was booted, ... unsigned int rotated2_tiled; ...
    (Linux-Kernel)
  • [EXPL] Snort Back Orifice Preprocessor Buffer Overflow (Exploit)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... * char buf1; ... unsigned int ret_off; // offset from buf1 to saved eip ...
    (Securiteam)