parse error before ')' token

This is a discussion on parse error before ')' token within the C Programming forums, part of the General Programming Boards category; 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 ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,439
    > 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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 12: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, 04:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21