ROBOTC.net forums
http://www.robotc.net/forums/

Dynamic sized arrays in RobotC?
http://www.robotc.net/forums/viewtopic.php?f=1&t=4956
Page 1 of 1

Author:  fxlj007 [ Sun Oct 07, 2012 5:55 am ]
Post subject:  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?

Author:  mightor [ Sun Oct 07, 2012 7:37 am ]
Post subject:  Re: Dynamic sized arrays in RobotC?

Not that I know of and if it does exist, it is not exposed to the users.

- Xander

Author:  fxlj007 [ Sun Oct 07, 2012 9:49 am ]
Post subject:  Re: Dynamic sized arrays in RobotC?

So RobotC doesn't support any dynamic memory allocation, right?

Author:  mightor [ Sun Oct 07, 2012 10:04 am ]
Post subject:  Re: Dynamic sized arrays in RobotC?

That is correct.

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/