

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is long long in C/C++?
In some cases we use long long in C or C++. Here we will see what is basically long long is? The long long takes twice as much memory as long. In different systems, the allocated memory space differs. On Linux environment the long takes 64-bit (8-bytes) of space, and the long long takes 128-bits (16-bytes) of space. This is used when we want to deal with some large value of integers.
We can test the size of different types using this simple program.
Example
#include <iostream> using namespace std; main() { int a; long b; long long c; cout << "Size of int = "<< sizeof(a) <<" bytes \n"; cout << "Size of long = "<< sizeof(b) <<" bytes\n"; cout << "Size of long long = "<< sizeof(c) <<" bytes\n"; }
Output
Size of int = 4 bytes Size of long = 4 bytes Size of long long = 8 bytes
Output may differ in different systems. Here windows platform is used for testing.
- Related Questions & Answers
- What is a Long Straddle in Investment?
- Convert long primitive to Long object in Java
- Long Pressed Name in C++
- What is the size of int, long type in C++ standard?
- What is the difference between an int and a long in C++?
- How to convert Long array list to long array in Java?
- What is the size of int, long type as per C++ standard?
- Convert Decimal to Int64 (long) in C#
- Need of long data type in C
- Convert Long into String using toString() method of Long class in java
- Long-term Evolution (LTE)
- How long is the SHA256 hash in MySQL?
- C# program to convert string to long
- Compare Two Java long Arrays
- Difference Between int and long
Advertisements