chipKIT® Development Platform

Inspired by Arduino™

Vectors, Lists & Collections?

Created Sat, 12 Nov 2011 05:57:38 +0000 by laelfrog


Sat, 12 Nov 2011 05:57:38 +0000

The project that I'm working on uses variable collections of items. What kinds of datastructures do I have available to me?

I was originally looking for a vector, but I couldn't find what to include. Can I use Vectors on the ChipKIT?


Sat, 12 Nov 2011 09:38:36 +0000

If you implement them... :-)

The ChipKit/Arduino/xxx-gcc language is awfully close to bare K&R "C". There aren't a bunch or "rich data type" classes that you can just include the way you could on a desktop environment with extensive libraries. (that said, there's no particular reason that a generic vector class from the desktop world wouldn't work on ChipKit, other than memory constraints. And dependency hell, of course :-( )

malloc() tends to be relatively difficult on systems with as little memory as a ChipKit, making most dynamically sized data structures problematic.