Go to Post You can't lose if you submit an animation. Even if you don't win an award, your team wins by just doing it. - David Brinza [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-03-2005, 19:21
BillyJ BillyJ is offline
Registered User
no team
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Texas
Posts: 13
BillyJ is an unknown quantity at this point
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?
  #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...
__________________

Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.h and Functions and Variables amateurrobotguy Programming 1 26-02-2005 03:19
Need help with Variables ? David Bryan Programming 5 23-02-2004 07:42
To Maximum Oz and Two Train Joe Matt Thanks and/or Congrats 1 09-03-2003 13:03
VB Program to monitor robot variables DanL Programming 7 15-02-2002 22:35


All times are GMT -5. The time now is 00:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi