Integer Memory | Sololearn: Learn to code for FREE!

+1

Integer Memory

Soo imagine that im writing a program and i only work with integers, and those integers are all from 0 to 10, would be better to replace all my variable declarations for the type "short"? and use 2 bytes less? In fact why dont i use the type char since it can also store integers that fit into 1 byte of memory? Is this correct? or should i use int instead of other types?

9/25/2019 6:37:07 PM

Denomycor

1 Answer

New Answer

+3

Tricky decision. See here for details https://stackoverflow.com/q/24371077/7986108