Re: Convert a very long int value To Hex
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Tue, 28 Aug 2007 16:19:39 +0000 (UTC)
In article <1188294106.209614.216350@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ahmad Jalil Qarshi <Ahmad.Jalil.Qarshi@xxxxxxxxx> wrote:
Thanks all for your kind support. I have used the following code and
it worked fine.
unsigned long long val = 998796744563877ll;
printf("Hex is: %llX\n", val);
That's okay in that range of values, but the original
initializer you posted with had more digits, and using that pattern
could lead to problems with larger numbers. The 'll' modifier
on the literal is for -signed- numbers; if the literal exceeds
the range of -signed- long long then the value you get out
would be unspecified. If you use a 'ull' or 'ULL' modifier on
the literal, the behaviour would be well defined.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
.
- References:
- Convert a very long int value To Hex
- From: Ahmad Jalil Qarshi
- Re: Convert a very long int value To Hex
- From: cr88192
- Re: Convert a very long int value To Hex
- From: Ahmad Jalil Qarshi
- Convert a very long int value To Hex
- Prev by Date: Re: Alignment, Cast
- Next by Date: Re: Alignment, Cast
- Previous by thread: Re: Convert a very long int value To Hex
- Next by thread: Re: Convert a very long int value To Hex
- Index(es):
Relevant Pages
|