C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

C++

How many bytes does int carry

27th Nov 2016, 8:02 AM
Ashutosh Kumar
Ashutosh Kumar - avatar
7 Answers
+ 2
it depend on the compiler to compiler in turbo it is 2 bytes and in codeblocks it is 4 bytes.
27th Nov 2016, 8:14 AM
DEATH WALKER
DEATH WALKER - avatar
+ 1
2 bytes
27th Nov 2016, 8:02 AM
Ashutosh Kumar
Ashutosh Kumar - avatar
+ 1
2
27th Nov 2016, 8:32 AM
ERFIRE
ERFIRE - avatar
+ 1
you can use the keyword "sizeof" that it return bytes of data type example: int n; cout<<sizeof(n);//4 bytes
27th Nov 2016, 9:48 AM
Leo Flame
Leo Flame - avatar
+ 1
2 bytes in 32 bit machine
27th Nov 2016, 10:39 AM
Utkarsh Hemrajani
Utkarsh Hemrajani - avatar
+ 1
4 bytes in 64 bit machine
27th Nov 2016, 10:39 AM
Utkarsh Hemrajani
Utkarsh Hemrajani - avatar
0
Use sizeof(), it depends on architecture
6th Jan 2019, 8:12 PM
Paolo De Nictolis
Paolo De Nictolis - avatar