9 years ago.

Garbage values in float/int array

Hi there!

When I create an array in mbed as:

char data[]={5,7,5,8,9,1,7,8,2,5,1,4,6,2,1,4,3,8,7,9}; the array of corrct size, i.e. 20 is created.

However, when I write:

float data[]={5,7,5,8,9,1,7,8,2,5,1,4,6,2,1,4,3,8,7,9}; I get an array of size 80 with lots of garbage values like zeros and some very large numbers in the end.

What could be the reason?

Thanks.

Be the first to answer this question.