Dun Peal
Dun Peal

Reputation: 17679

Is `long` identical to `long long` on LP64?

Looking through a fundamental C++ type reference, you see that on LP64, long is 64 bits, just like long long on the same platform. Does that mean that these two types are identical on an LP64 platform?

Upvotes: 1

Views: 124

Answers (2)

MSalters
MSalters

Reputation: 179779

No, take for instance:

 void foo(long);
 void bar()
 {
   foo(5L);
 }
 void foo(long long val)
 {
   std::cout << val;
 }

This fails to link.

Upvotes: 0

user529758
user529758

Reputation:

No, it doesn't. It only means that they are equally wide.

Upvotes: 4

Related Questions