On Mon, Jun 28, 2010 at 09:01:29PM +0530, Prakash wrote:
> How to handle u_int64_t type variables.
> 
> u_int64_t value = 39952034381;
> 
> when I tried to set the value, I am getting the following message.
> 
> truncating integer value > 32 bits

The integral constant 39952034381 is too large to fit into a 32-bit integer,
which is what you intend when you just give a sequence of digits. This is
independent of where the value goes when it's assigned.

If you intend a long-long integral value, then add LL:

> u_int64_t value = 39952034381LL;

But this is actually an *unsigned* long long, so make it:

> u_int64_t value = 39952034381LLU;

Please note: it's helpful when you mention the type of compiler when
asking for compiler help.

Steve

-- 
Stephen J Friedl  | Security Consultant |  UNIX Wizard  | 714 694-0494
st...@unixwiz.net | Orange County, CA   | Microsoft MVP |  unixwiz.net

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to