
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
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 Articles
- What is a Long Straddle in Investment?
- What is the size of int, long type in C++ standard?
- Long Pressed Name in C++
- What is a long winter sleep called?
- Convert long primitive to Long object in Java
- What is the difference between an int and a long in C++?
- What is the size of int, long type as per C++ standard?
- Need of long data type in C
- Convert Decimal to Int64 (long) in C#
- Long Time ("T") Format Specifier in C#
- Long Date ("D") Format Specifier in C#
- How long is the universe?
- How to convert Long array list to long array in Java?
- Is there any need of “long” data type in C and C++?
- What is the best cryptocurrency to invest in for long term?

Advertisements