Smoothing, arrays and for loop help, please

Hi, I'm working the smoothing tutorial and have nothing at the serial monitor. The link is here https://www.arduino.cc/en/Tutorial/Smoothing

I don't' understand this declaration: 'int readings [numReadings];' where numReadings is a const of 10 (the size of the array), so what does that make the integer called readings??

Similarly, later in the for loop itself is 'readings [thisReading] = 0;'

Regards,

Al

That's called an array, an array of integers to be precise... Google is your friend :wink:

OK, they (me) are called newbies for a reason. What is the answer to the question “so what does that make the integer called ‘readings’??” that was embedded in my post?
If my question doesn’t make sense, e.g. “why is the offspring of a lion called a potato?” then tell me and suggest what question I should be asking :slight_smile:
And what is a fricking code tag? I’m a newbie, remember??
Al

Let's start back to front

Physwiz:
And what is a fricking code tag? I’m a newbie, remember??

That's why there is a big fat sticky at the top of each board called How to use the forum. :wink:

And some examples to hopefully answer your question

int foo; //(declaration of an) int
int bar[10]; //(declaration of an) array of int, size 10
bar[4]; //(use of the) entry of an array with type int
//which is the same type as simply 'foo' :)

Aka, same as real life
You have a single cow (in code 'cow duke')
You have a group of 10 cows called stableA (in code 'cow stableA[10]')
And the 5th cow in stableA is still just a cow (in code 'stableA[4]')

Thanks Septillion. Code tags, OK. A bit clearer now. The serial monitor still mocks me in the totality of its whiteness, however. Is your foobar the same as my fubar? “* up beyond all recognition”?