View Single Post
  #2   Spotlight this post!  
Unread 06-03-2005, 20:35
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Maximum Variables

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...
__________________