This is more a c++ question (or maybe an Arduino print question)? I have initialized a 2 dimensional array and attempt to access the array produced unexpected results. For the array below, I expect to get the 3 values assigned to row 0 but I get these 3 values instead? 1 , 4 and 7. Is this a problem with the way print is working or some issue with the way I am accessing the array? It looks ok to me but I cannot see what is happening. Its probably something very simple/silly I have overlooked. Note: If I set up a 1-dimensional array and test it, I get correct elements returned. byte freq[10][3] = { {0x69,0x00,0x11}, //420 {0x69,0xc0,0x11}, //423 {0x6a,0x80,0x11}, //426 {0x6b,0x40,0x11}, //429 {0x6c,0x00,0x12}, //432 {0x6c,0xc0,0x12}, //435 {0x6d,0x80,0x12}, //438 {0x6e,0x40,0x12}, //441 {0x6f,0x00,0x12}, //444 {0x6f,0xc0,0x12} //447 }; Serial.print(byte(freq[0,0])); Serial.print(byte(freq[0,1])); Serial.print(byte(freq[0,2])); Thanks
|