Error with handing over an arry to a function


hi,

i wrote function, error:
code: [select]
o: in function `loop':
undefined reference `check_touch(int, int, int*)

this code:
code: [select]
boolean check_touch(int x, int y, int field[]);

void setup(){
}

void loop(){
 int mousey = 21;
 int mousex = 2;
 int main_button[] = {2,6,3,5};
 if(check_touch((int)mousex,(int)mousey,main_button)){
   //do something
 }
}

boolean ckeck_touch(int x,int y,int* field){
 if((x>field[0])&&(x<field[1])&&(y>field[2])&&(y<field[3])){
   return true;
 }
 else{
   return false;
 }
}


what wrong? can't find mistake.

greetings
philipp

code: [select]
boolean ckeck_touch

the arduino ide has handy feature finding sort of thing.
if type "ctrl-f", pops dialogue.
in field labelled "find:" enter name of thing in error message (int case "check_touch"), click on "find".
if don't find expect it, you've found bug!


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Error with handing over an arry to a function


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums