r/cpp_questions • • Aug 31 '25

OPEN What is long long

I saw some c++ code and I noticed it has long long, I never knew you could put 2 primitives next to each other. What does this do?

1 Upvotes

37 comments sorted by

View all comments

13

u/y53rw Aug 31 '25 edited Aug 31 '25

All of the fundamental types are here.

https://en.cppreference.com/w/cpp/language/types.html

Note that some types can be written multiple ways. long long can also be written long long int or signed long long int or signed long long.

0

u/no-sig-available Aug 31 '25

Note that some types can be written multiple ways. long long can also be written long long int or signed long long int or signed long long.

Or, if you want to go all the way, long signed int long also works. :-)

The rules just say that the words can be combined, but the order isn't specified. You can also add const, volatile, or typedef anywhere in the soup.

1

u/tangerinelion Sep 01 '25

Sure, class loong { static constexpr inline volatile long const signed int long x = 0; };. Beautiful.