Placing msgBits where - 1 is absent i . e . , except redundant bits all positions are msgBits
if ( hammingCode [ i ] != -1 ) { hammingCode [ i ] = msgBits [ j ] ; j ++ ; } } for ( int i = 0 ; i < ( r + m ) ; i ++ ) {