What is the meaning 0xfb00000000000LL

G

Guest

What is the purpose of the LL in the end , Any way it is long long

If you do not put the LL at the end it will be treated as a literal int,
for which the value is too big so you would not get the value you
expected. Notice also that long long is not part of the current standard
(but will be in the next).
 
M

Markus Moll

Hi
If you do not put the LL at the end it will be treated as a literal int,

No, currently the type is chosen as the first one that is big enough in the
sequence:

int, long int (for decimal literals)
int, unsigned int, long int, unsigned long int (for octal and hexadecimal
literals)

If it does not fit into the largest type, strictly speaking, the program is
ill-formed. However, I would expect any reasonable compiler to support long
long already.

The suffixes are useful mainly if you want to denote e.g. a small long:

void f(int);
void f(long);

f(3L); // call the long overload


Markus
 
O

Old Wolf

If you do not put the LL at the end it will be treated as a literal int,
for which the value is too big so you would not get the value you
expected.

This seems to be a fairly common misconception
(i.e. if the suffix is omitted, the value is
treated as an int regardless) - does anyone
know where it came from?
 
B

Ben Pfaff

Old Wolf said:
This seems to be a fairly common misconception
(i.e. if the suffix is omitted, the value is
treated as an int regardless) - does anyone
know where it came from?

Perhaps it is because most integer constants have type int? I
imagine that programmers just extrapolate from "most" to "all".
 
G

Gianni Mariani

Old said:
This seems to be a fairly common misconception
(i.e. if the suffix is omitted, the value is
treated as an int regardless) - does anyone
know where it came from?

Probably from compiler bugs.
 
J

James Kanze

What is the purpose of the LL in the end , Any way it is long long

The purpose of the LL is to make it a long long. Otherwise, the
type depends on the machine---on my machines, it's a long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top