How to specify the size of a class array ?

tuxduino:

PaulS:

What about growing the array ? Is it safe ?
That would happen when the user would call addBoard() more times than the available slots in the array.

Until all available memory was used, it is safe.

I should probably RTFM about this :slight_smile: but in the meantime, do you mean realloc() is "safe", i.e. doesn't have problems like free() ?

Essentially, with the library bug, it's okay to allocate memory as long as you don't expect it back.

realloc calls free if the new chunk size is smaller