fonction and "if" bug

hi ,

i have a bug in my project , i have recreate a code for an exemple, the fonction it call even if the "if" as not complet , pleaz help me !

(sorry for my orthograph i am french)

int cb = 1 ;
void setup() {

  Serial.begin(9600);
}

void loop() {

  if (cb == 10) ; {
    real();
  }
  delay(1000);
  cb++ ;
}

void real() {
  Serial.println("finish");
}

if (cb == 10) ;

Get rid of the ;

If you have any more questions you’ll probably find it easier to post them in the Français forum.

Pete

The compiler understands this code as meaning:

 if (cb == 10) 
   ; // do nothing


  { // an unnecessary pair of {braces}
    real();
  }

  delay(1000);
  cb++ ;