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.

7

u/Warshrimp Aug 31 '25

Wouldn't it be great if char = 8, short = 16, int = 32, long = 64 and long long were 128? I hope the next time someone treats a new data model they stick with this.

1

u/heyheyhey27 Sep 02 '25

C++ goes out of its way to support odd architectures, including ones that don't do 8 bits per byte and ones that only have 7-bit chars limiting their character set.