I have an input of one integer from 1 up to 100(lets call this N). Then another N number of boolean inputs (lets call this J). J is an array with the size of N
bool J[N] = {};
I would like to know how many boolean true (1) values "stand" next to each other.
So two trues after one another means one plus to the output.
The output is the number of paths between the true values.
for example:
0
0
1
1 - one here
1 - another one here
0
1
0
1
1 - and the last one here
Would mean the output is 3
but i get 0 as an output, which indicates to me that the 'if' didnt activate
1 2 3 4 5 6 7
for (z = 0; z < N ; z++)
{
if ((J[z] == true) && (J[z+1] == true))
{
output++;
}
}