for (int i =0; i<x; i++) //x needs to be 16 here { //do } for (int i = 10; i< remaining length; i++) //remaining length needs to be 4 { //do }
for (int i =0; i<x; i++) //x needs to be 16 here { //do } for (int i = 10; i< remaining length; i++) //remaining length needs to be 16 { //do }
int X=20; for(int Start=0; Start < X; Start += 16){ int End= (Start+16 < X) ? Start+16 : X; for(int i= Start; i < End; i++) { // your logic } }
int blocks = x / 16; int spare = x % 16; int counter = 0; for (int b=0; b<blocks; ++b) { for (int n=0; n<16; ++n) { //... } } for (int n=0; n<spare; ++n) { //.. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)