If I understood correctly, you want to move the non-zero elements at the beginning of your array. You could use std::remove_if
to do this and set the rest of the elements to 0.
std::fill(
std::remove_if(std::begin(aBlock), std::end(aBlock), [](char const c) {return c == '\0'; }),
std::end(aBlock),
0);
UPDATE:
Since the array is dynamically allocated you need a small change:
std::fill(
std::remove_if(&aBlock[0], &aBlock[100], [](char const c) {return c == '\0'; }),
&aBlock[100],
0);