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
}