Variable Ranges

Hi. I am making a programming guide specifically geared towards our middle school robotics program (Hosting 19 teams this year, wow)

I was looking at the F1 documents in EasyC V4, and I see that int and long have the same range, and that they are both 32 bit. I would just like to clarify if this is correct or not, because I thought integers were smaller.

Andrew K.

You can never be sure of the size of int, it varies depending on the compiler, mcu and programming environment. ROBOTC changed the size of int between V3.xx and V4.xx, it used to be 16 bit and is now 32 bit. If you know you need 16 bit use short, if you know you need 32 bit then use long, int could be either (and potentially even 64 bit if that is the native register size of the mcu).

In EasyC I believe int is 32 bit.

Alright, I’ll go with what the documentation says then. Thanks!