Create a dynamic array for SSD1306 display

Hello, I'm trying to create an array which is filled dynamically as the data is received. After this, I'm trying to display the array on SSD1306.
I'm using the U8glib for display which works perfectly for static arrays (defined in program itself).

The problem here is, the array I need is dynamic and what is available for the drawBitmapP( ) function is of 'const' type because it needs to be in PROGMEM.

I found that the Adafruit SSD1306 has some function which doesn't require PROGMEM to be used but unfortunately Adafruit doesn't display the bitmap on my SSD1306 and only U8glib does.

Is there any such function I can use or place inside the .cpp file for u8g library specifically? Any other solution for dynamic array would be appreciated. Please help, I need this for my academic project, I'm not getting the solution.

I don't know anything about U8glib etc but if you mean an array whose size is extended at runtime then that is a bad idea in the limited memory of an Arduino. It can cause memory corruption in the small memory on an Arduino. This can happen after the program has been running perfectly for some time.

Just create a fixed array that is big enough for your largest chunk of data and store the data in it as it arrives.

...R

I have a fixed array size of 1024 but it gets filled dynamically. 'const' is the problem.

yashpawse16:
I have a fixed array size of 1024 but it gets filled dynamically. 'const' is the problem.

That makes no sense without being able to see the program (the complete program, please).

...R