Confused about error

I am trying to play around with zig and have the following code:

    var p: u8 = 0;
    var temp: u8 = undefined;
    while ( i < ar.len ) : ( i += 1 ) {
        p = 0;
        while ( p < ar.len ) : ( p += 1 ) {
            if ( p == ar.len ){ break; }
     
            if (ar[p] > ar[p+1] {
                temp = ar[p+1]; //error here
                ar[p+1] = ar[p]; 
                ar[p] = temp;
                }
        }

The error says: expected a ‘,’ after initializer

I’m sure it is something simple but not getting it.

Thanks,

Glenn

You forgot the closing parenthesis on the if

thanks, error had me looking in the wrong spot. :slight_smile:

Glenn