Sensor Array Request for Member '...' in '...' error message


Apologies, this is the first time I have tried programming. I have the following sketch:

int pins = {0,1,2,3,4,5};
int *values = new int[6];

void setup() {

for (int i = 0; i < pins.length; i++) {

void loop() {


To read input voltages 0-5V to the 6 analogue pins on my UNO R3 from IR Sensors (Pololu QTR-8A sensor array). I want this part of the sketch to read the values from the sensors - I will later develop this to control continuous rotation servos.

For the line:

for (int i = 0; i < pins.length; i++) {

I have the following error message:

"Request for member “length” in “pins”, which is of non-class type ‘int [6]’ ".

What needs to change?

Thank you.

This is C++, not Java. Please remember to use code tags when posting code.

What needs to change?

Your code. Why do you think that an int array has a member named length?

Why are you dynamically allocating an array whose size never changes and which never goes out of scope?