no matter how much u increase ur int value data type type will return same value | SoloLearn: Learn to code for FREE!

0

no matter how much u increase ur int value data type type will return same value

e.g if u int=4; char size will be 1 if int=4444444; char size will be still 1...why is that?

12/25/2016 12:57:46 PM

Aqib Asmat

1 Answer

New Answer

+1

The int type (and all primitive types in C++) have a fixed width. This width is primarily determined by the architecture of the computer. It doesn't matter how big or small of a value you put in to any of the primitive types, it will remain the same size and take up the same space in memory. You will need to be careful however as this means that these variables have limits to how large of a value you can store in then before they overflow.