Author Topic: Error pri programovani  (Read 2821 times)

Corleone

  • Newbie
  • *
  • Posts: 6
    • View Profile
Error pri programovani
« on: 14.04.2012, 18:27:38 »
Prosim vas moze mi niekto pomoct? V netbeans mi stale vypisuje ,,parse error before printf,, v tejto casti pri else:

int main (int argc, char** argv) {
   
     turnOn();
   
    turnLeft();
    if (frontIsClear())
        printf ("ide to");
    else (frontIsBlocked())
            printf ("nejde to");
   
 return (EXIT_SUCCESS);
 
}


(main.c: In function `main':
main.c:37: error: parse error before "printf"
make[2]: *** [build/Windows/Cygwin_1-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2)

iren2118

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Error pri programovani
« Reply #1 on: 14.04.2012, 18:29:34 »
Prosim vas moze mi niekto pomoct? V netbeans mi stale vypisuje ,,parse error before printf,, v tejto casti pri else:

int main (int argc, char** argv) {
   
     turnOn();
   
    turnLeft();
    if (frontIsClear())
        printf ("ide to");
    else if(frontIsBlocked())
            printf ("nejde to");
   
 return (EXIT_SUCCESS);
 
}


(main.c: In function `main':
main.c:37: error: parse error before "printf"
make[2]: *** [build/Windows/Cygwin_1-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2)

pri else ti chyba if, alebo potom vynechaj (frontIsBlocked())

Corleone

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error pri programovani
« Reply #2 on: 14.04.2012, 18:35:56 »
Vrela vďaka  :)

Marek_Baranica

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: Error pri programovani
« Reply #3 on: 15.04.2012, 00:25:25 »
else nema podmienku, else je ked nevyhovuje if podmienke tak sa vykona vsetko co je za else
ale asi si len zabudol dalsi if dat.
keby daco napis, alebo pozri na webe jaku ma syntax if else ;)
v par prikladoch lahko pochopis