ISO C++ forbids comparison between pointer and integer

Hello,

I am having some trouble with the fundamental code of my Arduino. Below you will find the error message and the code.

What I am trying to accomplish is the ability to compare the memory location stored in the variable "one" and the memory location of "letter[0][2]". This is part of a bigger program, which I simplified to post here.

Any guidance would be appreciated.

Arduino: 1.0.5 (Mac OS X), Board: "Arduino Diecimila or Duemilanove w/ ATmega168"
sketch_sep22a.ino: In function 'void loop()':
sketch_sep22a:18: error: ISO C++ forbids comparison between pointer and integer

String letter[6] [4] = {  {"G", "F", "F", "E"},
                        {"C", "B", "A", "A"},
                        {"F", "E", "D", "D"},
                        {"A", "A", "G", "G"},
                        {"D", "C", "C", "B"},
                        {"G", "F", "F", "E"}  };
void setup(){}

void loop () {

int one;
int two;

one = whatup(); //victor value is stored into one.


if (one == &letter[0][2]){
  Serial.println("You have selected letter G-B");

  
  delay (2000);
}
}

int whatup(){  

String *victor; // Set up pointer
victor = &letter [0] [2]; // Stores memory location 

return (int)victor; // return pointer 
}

Drop the & in front of letter[][]. That turns the value into a pointer (address)

if (one == &letter[0][2]){

Why do you have the & there? letter is a 2D array of those god-awful String instances. How you expect the address of an instance to equal an int is beyond me.

return (int)victor; // return pointer

That is an incredibly stupid cast. Casting a pointer to a String as an int makes no sense.

If you want the String instance at some location in the array, the function should return a String instance.

Actually, the function should return a char *, and you should not be using Strings.

I think what was intended is a 2-D array of char, as a letter is a char,
so:

char letter[6] [4] = {  {'G', 'F', 'F', 'E'},
                        {'C', 'B', 'A', 'A'},
                        {'F', 'E', 'D', 'D'},
                        {'A', 'A', 'G', 'G'},
                        {'D', 'C', 'C', 'B'},
                        {'G', 'F', 'F', 'E'}  };

Then you'll be using many times less RAM (20 times less or so).

I think what was intended is a 2-D array of char, as a letter is a char,

OPs other post on the same topic has strings at each cell.