Difference between data types (int8 and float)

Hi, I'm trying to execute array on esp32 in different types,
the size of array that can upload to esp32 for example
int size= 2000 more than I can't (this size just for example)

"Upload" from where?

Please post code, not snippets.

I mean from sketch to esp32,

Both of your arrays are arrays of pointers, so they will be the same size.

could you explain more please?

I doubt the arrays have the same size.
How did you test for the size of the array that you allocate?
I would guess the uint8_t array occupies one fourth bytes as the other array.

I was wrong, you are only allocating a single pointer. The actual memory for the array is not allocated until runtime.

You've edited your original post, but what you have added is still only a snippet

I'm just wondering about the size , as you know that the esp32 memory is limited so big data we can't upload it... so I thought that when defining a float array it needs fewer elements than int8 ... I can't share the all code :slight_smile:

All memory is limited

Please explain what you mean by the two uses of "upload" in your last post

Very limited in the esp32... upload the code from the Sketch to the esp32

Even more so on an AVR.

I fail to see what point you're trying to make - if you can't upload all the code, how is the sketch running?

You have it backwards. An int8_t takes only one byte. A float is always a multi-byte type.


You are not declaring an array, you are declaring a pointer to a block of memory that will be allocated at runtime. The compiler only shows the memory use that it can calculate at compile time.

Yes, based on this talk. It is assumed that when defining a float array , it takes the least number of elements in order to be processed on the esp!!

Because it consists of multiple sketch, it is not possible to post them here!


Why ?!

One sketch can not be more than one.