Go Down

Topic: How to add data to an array or declare variable size array (Read 837 times) previous topic - next topic

AlexMunFlo

Good evening

I have a task where I must register the high and low values in a senoidal wave. I already know how to get the data from de ADC, but for this part I thought about having an array which wouldn't have a exact number of elements and add them whenever the Arduino found a high or low point. I already tried with "arrays with no fixed size or elements, but didn't work. I also read about concatenating Strings, but I must use the data in other processes. So my question is:

1- How do I declare an variable size array?

and

2- How to concatenate data to a variable?

Thanks in advance. I attach my test program.

Grumpy_Mike

Quote
How do I declare an variable size array?
You can't, that is not permitted in C/C++.

Go Up