🌐
GeeksforGeeks
geeksforgeeks.org › c language › data-types-in-c
Data Types in C - GeeksforGeeks
We use int keyword to declare the integer variable: Size: typically 4 bytes, Range: -2,147,483,648 to 2,147,483,647. Format specifier: %d. Format specifiers are the symbols that are used for printing and scanning values of given data types.
Published   April 22, 2026
🌐
Wordpress
learningmicro.wordpress.com › data-types-and-there-sizes-in-c
Data Types and There Sizes in C – Learning Embedded System and Microcontrollers
March 4, 2019 - There are only 4 basic data types defined in C and they are: char: a single byte, capable of holding one character in the local character set int: an integer, typically reflecting the natural size of integers on the host machine float: ...
Discussions

Do the sizes of data types in C such as char, short, and int have specified minimum size or relative in the C standard?
You literally have the C standard linked above your post. Why wouldn't you read it, rather than asking chatGPT? https://www.reddit.com/r/C_Programming/comments/1ay92d4/latest_working_draft_n3220/ Read section 5.2.5.3.2 More on reddit.com
🌐 r/C_Programming
16
0
October 9, 2024
The size of a data type in C.
Integers are not stored as characters, they're stored as binary values. In your case, an integer uses 32 bits of memory (4 bytes), which is why the range of possible integer values is 232. More on reddit.com
🌐 r/learnprogramming
6
8
April 11, 2021
size of basic data types in C - Stack Overflow
I have a sample program that I copied from some website. int main(void) { int answer; short x = 1; long y = 2; float u = 3.0; double v = 4.4; long double w = 5.54; char c = 'p... More on stackoverflow.com
🌐 stackoverflow.com
Which is the size of an int in ESP32?

int is 32 bit, -2,147,483,648 to 2,147,483,647. Enough for almost 25 days worth of milliseconds (or almost 50 days if unsigned)

long is 64 bit (-9223372036854775808 to 9223372036854775807). I don't know the performance impact of 64 bit operations on the ESP32, but that'd give you almost 300 million years worth of millisecond ticks.

Although, if you just want a millisecond counter, I suggest using the "millis()" function: returns the number of milliseconds since it was powered on.

More on reddit.com
🌐 r/esp32
12
4
October 10, 2020
People also ask

Why do we use the floating data types?
The C language specifies two of the primary data types for storing the fractional numbers or the floating-point. These are double or float. One can easily apply the long qualifiers on the double. Thus, we get another type, which is the long double. · In a computer system, the IEEE-754 format represents the floating-point numbers. A majority of modern processors and processors adopt this format. It has two major representations: · 1. 32-bit single precision · 2. 64-bit double precision
🌐
byjus.com
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
What differentiates the range for unsigned and signed types?
Although the size of any unsigned as well as the signed data type is all the same, they both possess different ranges of values to be stored in any variable. Why? It is because the representation of the signed numbers is in 2’s complement form in any processor or machine. For instance, the representation of the number -23 in the form of 2’s complement would be: (Decimal) 23 <-> (Binary) 10111
🌐
byjus.com
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
data type supported by the C programming language
In the C programming language, data types constitute the semantics and characteristics of storage of data elements. They are expressed in the language syntax in form of declarations for memory locations or … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › C_data_types
C data types - Wikipedia
April 7, 2026 - Since C23, the only representation allowed is two's complement, therefore the values range from at least [−2n−1, 2n−1−1]. ... ^ a b Uppercase differs from lowercase in the output. Uppercase specifiers produce values in the uppercase, and lowercase in lower (%A, %E, %F, %G produce such ...
🌐
Reddit
reddit.com › r/c_programming › do the sizes of data types in c such as char, short, and int have specified minimum size or relative in the c standard?
r/C_Programming on Reddit: Do the sizes of data types in C such as char, short, and int have specified minimum size or relative in the C standard?
October 9, 2024 -

So, I ask this question because in my C class at college, my professor said that in the C standard, only relative size of char short and int are specified to keep the language flexible to any hardware architecture setup. sizeof char <= short <= int. ChatGPT seems to have confirmed this saying:

Relative Size: In C, data types such as char, short, int, and long are defined in terms of their relative sizes. The C standard specifies that:However, the absolute size (in terms of number of bits or bytes) of these types is not fixed by the C standard. For example, the size of an int or short can vary depending on the architecture or the compiler. This flexibility allows C to work across different systems.

sizeof(char) must always be 1 byte (this is guaranteed),

sizeof(short) must be at least as large as sizeof(char),

sizeof(int) must be at least as large as sizeof(short),

sizeof(long) must be at least as large as sizeof(int).

Absolute Size: The actual size in terms of bits can vary by platform. For example, on many modern systems:

char is usually 8 bits,

short is often 16 bits,

int can be 16 or 32 bits (commonly 32 bits nowadays),

long can be 32 or 64 bits (often 64 bits on modern systems).

Technical Point from Your Professor: Your professor is correct in saying that, technically, all of these types could be 9 bits, as long as the relative size constraints are followed. This would be unusual, but C is designed to be flexible and portable across different architectures. The key is that the relative sizes of types must adhere to the standard's requirements, but the absolute size of the types may vary.

However, on the Wikipedia page for C data types:

The actual size of the integer types varies by implementation. The standard requires only size relations between the data types and minimum sizes for each data type:

The relation requirements are that the long long is not smaller than long, which is not smaller than int, which is not smaller than short. As char's size is always the minimum supported data type, no other data types (except bit-fields) can be smaller.

The minimum size for char is 8 bits, the minimum size for short and int is 16 bits, for long it is 32 bits and long long must contain at least 64 bits.

Can someone tell what is correct and perhaps provide a definitive source? Maybe I am misunderstanding something or my professor is working with outdated information.

🌐
BYJUS
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
February 16, 2024 - If the compiler was 32-bit wide, the int type size would have been about 32-bits or 4 bytes. However, this might not be the case every single time. It is also possible that the integer size is 32-bits or 4 bytes for a 64-bits processor.
🌐
Programiz
programiz.com › c-programming › c-data-types
C Data Types
You can declare multiple variables at once in C programming. For example, ... The size of int is usually 4 bytes (32 bits). And, it can take 232 distinct states from -2147483648 to 2147483647. ... In C, floating-point numbers can also be represented in exponential.
Find elsewhere
🌐
W3Schools
w3schools.com › c › c_data_types.php
C Data Types
1 month ago - In this tutorial, we will focus on the most basic ones: There are different format specifiers for each data type. Here are some of them: Note: It is important that you use the correct format specifier for the specified data type.
🌐
W3Schools
w3schools.com › c › c_data_types_sizeof.php
C sizeof operator
The memory size refers to how much space a type occupies in the computer's memory. To actually get the size (in bytes) of a data type or variable, use the sizeof operator:
🌐
Dot Net Tutorials
dotnettutorials.net › home › sizeof and limits of data type in c
Sizeof and Limits of Data Type in C - Dot Net Tutorials
November 30, 2023 - In C programming, the sizeof operator is used to determine the size of a data type or a variable in bytes. The size of data types can vary depending on the architecture and compiler used.
🌐
IDC Online
idc-online.com › technical_references › pdfs › information_technology › C_Data_Types_and_Sizes.pdf pdf
C Data Types and Sizes 
There are number of qualifiers such as short,long,signed,unsigned can be applied to · these primary data types.  · The possible qualifiers for the basic type are shown in the table · No Data Type · Qualifier · 1 · char · Signed,Unsigned · 2 · int · short,long,signed,unsigned · 3 · float · No qualifier · 4 · double · long · 5 · void · No qualifier ·  · Each compiler is free to choose appropriate size for its own hardware with ·
🌐
W3Resource
w3resource.com › c-programming › c-data-types.php
C Data Types - w3resource
April 8, 2026 - Size of C data types: Type Bytes ... char 1 int8_t 1 unsigned char 1 uint8_t 1 short 2 int16_t 2 uint16t 2 int 4 unsigned 4 long 8 unsigned long 8 int32_t 4 uint32_t 4 long long 8 int64_t 8 unsigned long long 8 uint64_t 8 float 4 double 8 long double 16 _Bool ...
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-program-to-find-the-size-of-int-float-double-and-char
C Program to Find the Size of int, float, double and char - GeeksforGeeks
July 23, 2025 - So, the idea is to store this pointer as integer and find the difference between the memory addresses to find the size in bytes. Note: This method only works if the system is byte addressable.
🌐
IncludeHelp
includehelp.com › c › basic-data-types-their-sizes.aspx
C language Basic Data Types and their Sizes
char represents character, it can be used to declare a character type variable, constant in C language. It takes only one byte (8 bits) in the computer memory and it stores a single character. The value range of char data type is -128 to +127.
🌐
Udemy
blog.udemy.com › home › it & development › software development › calculating the size of data types in c using sizeof
Calculating the Size of Data Types in C using Sizeof - Udemy Blog
April 14, 2026 - The `sizeof` operator is a unary operator in C that returns the number of bytes a data type or variable occupies in memory. This article covers its syntax, behavior with basic types, structs, arrays, and pointers, including struct packing quirks.
🌐
Vultr
docs.vultr.com › clang › examples › find-the-size-of-int-float-double-and-char
C Program to Find the Size of int, float, double and char | Vultr Docs
September 27, 2024 - The %zu format specifier is used for size_t type returned by sizeof. Initialize a float variable. Use the sizeof operator to determine its size. ... #include <stdio.h> int main() { float floatType; printf("Size of float: %zu bytes\n", ...
🌐
Unstop
unstop.com › home › blog › guide to data types in c (with detailed examples)
Guide To Data Types In C (With Detailed Examples)
May 31, 2023 - Finally, the return statement terminates the execution flow from the main() function. The character data type is represented by the char keyword and is used to store a variable with only a single character. The size of the char data type is 1 byte ...
🌐
MindMap AI
mindmapai.app › mind-mapping › data-types-and-memory-sizes-in-c-programming
C Data Types & Memory Sizes: A Comprehensive Guide
June 4, 2025 - Knowing these exact specifications helps developers choose the most appropriate type for their data, thereby optimizing resource usage and ensuring program reliability and optimal performance. int: Occupies 4 bytes, capable of storing whole ...
🌐
Scaler
scaler.com › home › topics › data types in c
Data Types in C - Scaler Topics
July 3, 2024 - It typically occupies 1 byte of memory, allowing it to store ASCII characters encoded using 7 bits. Characters are enclosed in single quotes when assigned to char variables, distinguishing them from strings.