Thread: parse error before ')' token

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    parse error before ')' token

    Hello!
    Code:
    for(j,j<32,j++){
                                    if(pieces[j].state==1){
                                        if(pieces[j].color!=*turno){
                                            pieces[j].state==0;
                                            pieces[i].square.file = file_dest;
                                            pieces[i].square.rank = rank_dest;    
                                            jog_inv=0;
                                        }
                                    }
                                    else{ 
                                        pieces[i].square.file = file_dest;
                                        pieces[i].square.rank = rank_dest;    
                                        jog_inv=0;
                                    }
                                }

    i got an error here, i dont know where is it, becouse i have the same code earlyer and dont,t get any error. can anyone help? thx

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > for(j,j<32,j++)
    Read your book.
    ; separate the components of a for loop, not commas.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Syntax Error Before ';' Token
    By subhadeepgayen in forum C Programming
    Replies: 10
    Last Post: 07-11-2010, 12:29 PM
  2. syntax error before '?' token
    By nullifyed in forum C Programming
    Replies: 9
    Last Post: 05-26-2010, 07:02 AM
  3. parse error before "{" token
    By getout in forum C Programming
    Replies: 4
    Last Post: 12-31-2006, 01:26 PM
  4. syntax error before '.' token
    By strij85 in forum C++ Programming
    Replies: 3
    Last Post: 07-14-2004, 08:04 PM
  5. Devcpp: parse error before ';' token
    By 1veedo in forum C++ Programming
    Replies: 17
    Last Post: 12-22-2003, 05:05 PM