Maximum Variables

How many variables can we declare before reaching the limit in memory?

I seem to remember that you can declare 1000 of type byte. Is this true? Is it possible to “un-declare” them wen ur done?

I don’t remember the specific memory sizes of the control, but I can help you out some. The number of variables you are able to declare will vary with what type you use. Obviously, the smaller a variable you use, the more you can have.

Sizes (in bytes) of the variable types:
char = 1
short int = 2
int = 2 (I think. On most modern PCs this is 4, but I think it’s only 2 on the RC)
long int = 4
float = 8
double = 16

For the variables you will be using, there is no way to manually release the memory that your variables take up. If you are using local variables which aren’t declared static (a local variable is one which is defined inside a function), then the memory it uses is on the stack, so when your function returns, the space is automatically released. There are ways to do dynamic memory allocation, but they’re probably beyond what you’ll want to do… :slight_smile: