Error with handing over an arry to a function
hi,
i wrote function, error:
this code:
what wrong? can't find mistake.
greetings
philipp
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_touchthe 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
Post a Comment