View unanswered posts | View active topics It is currently Thu Apr 17, 2014 6:16 pm






Reply to topic  [ 4 posts ] 
Dynamic sized arrays in RobotC? 
Author Message
Rookie
User avatar

Joined: Sun Jun 17, 2012 11:18 am
Posts: 26
Post Dynamic sized arrays in RobotC?
In standard C language, this is not available. I can only define array with constant size, unless using sth. like malloc(), which is not available in RobotC. But I am reading LEGO's "LEGO MINDSTORMS NXT executable file speci cation" http://mindstorms.lego.com/en-us/support/files/default.aspx, and it says:

Quote:
Arrays—A list of zero or more elements of any single sub-type. For example, you could use an
array of unsigned bytes to express a list of port numbers for controlling motors. The program can
resize arrays at run-time, which means that zero-length arrays are a valid concept. For example,
you can use zero-length arrays to hold a spot in the DSTOC for data which the program might
produce later. (p.7)


Is such function available in RobotC?


Sun Oct 07, 2012 5:55 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: Dynamic sized arrays in RobotC?
Not that I know of and if it does exist, it is not exposed to the users.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Oct 07, 2012 7:37 am
Profile WWW
Rookie
User avatar

Joined: Sun Jun 17, 2012 11:18 am
Posts: 26
Post Re: Dynamic sized arrays in RobotC?
So RobotC doesn't support any dynamic memory allocation, right?


Sun Oct 07, 2012 9:49 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: Dynamic sized arrays in RobotC?
That is correct.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Oct 07, 2012 10:04 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.