why do we use int instead of long


hello pretty dumb question :( why use int not long. long can store bigger numbers , small numbers. think long covers range of integer range. couldn't find results problem.  not beginner not pro :). know java too. never worked long type in java .
thank much
berathan

hello , welcome,

long take twice more memory int, on devices limited memory have consider using smallest variable possible ;)

for example if sure number range between 0 , 255, should use variable of type byte (or "uint8_t", same thing) take 1 byte. int take 2 bytes, long take 4 bytes.


Arduino Forum > Using Arduino > Programming Questions > why do we use int instead of long


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support