Get real pointer address

I’m using Arduino UNO.

The question is bit related to this thread : http://forum.arduino.cc/index.php?topic=64034.0

I’m trying to get the right pointer address of an two dim arrays. If I execute the following code, I get the pointer address to be 272 but when I search it using pgm_read_float, it happens to be at 3676 (in my case, obviously) and it depends of the content of the others variables in the program memory. So if I change a bit my code, that last value will change, 3524 for exemple.

Why do I get 272 all the time ? how to get the right address value ?

Here is the code :

#include <avr/pgmspace.h>

const float Array2D[3][10] = {
{ 6.6, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 },
{ 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 },
{ 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9 }
};

void setup(){
  float a; 
  int i ;
  int j; 
  int flag = 0;
  Serial.begin(9600);
  
  i =  &Array2D;
  Serial.print("Pointer :" );
  Serial.println(i);
  
  
  for (j = 0; j < 32000; j = j + 1 ) {
     a = pgm_read_float( j );
     if (a == 6.6) {
        flag = 1;
          Serial.print("16 bit address found :" );
          Serial.println(j);
     }
     
     if (flag == 1) {
        Serial.print( a );  
        Serial.print( " " );  
        if (j % 10 == 0) Serial.println();   
     }
  }
}

void loop(){}

Your array is in RAM, not flash.

Arrr.. ! sorry, I even't checked if PROGMEM was there, that's beacause I did too much tests these last few days, :frowning: okay.. prob solved