Why is it relevant to understand how many bytes are in a variable | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Why is it relevant to understand how many bytes are in a variable

Counting Bytes

27th Dec 2016, 10:17 PM
samwisethethird
samwisethethird - avatar
2 Réponses
+ 1
Because variable types store finite amounts data. Sometimes you may require more storage for your calculation.
27th Dec 2016, 11:29 PM
Cuinn Herrick
Cuinn Herrick - avatar
+ 1
1)This is useful if you want to optimize your program for a system with limited memory. You would then choose types with just the size required. 2)If a variable is defined with the wrong type and is too small to hold a value , the program will fail or have unexpected behaviour. this knowledge can help troubleshootand / avoid those issues.
28th Dec 2016, 9:25 AM
ifl
ifl - avatar