I am developing a library for an embedded system with very little storage in C++. I would like to declare an array for a specific use in one function, however I am unsure if I should declare this in the function as a static array (which would be ideal for my use case), or if I should declare it as a private member in a class. My hesitation to declaring it as a static array in the function, is because I am worried that declaring memory on the fly like that is not a good idea, and should be declared at runtime, however I am still learning so perhaps I am wrong.
Please let me know if you have any suggestions or clarifying questions!