title: Removing elements from array in C
body: <p>What I am trying to achieve is to loop through an array ONCE and while doing so, also remove elements that my function returns false for. However the code I've written does not work. Any idea would be greatly appreciated because I am truly stuck and I don't understand what I am doing wrong</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  
  bool isitright(int i) {
      if (i/2 == 0) {
          return false;
      } else {
          return true;
      }
  }
  
  int main() {
      int arr[4] = {0, 1, 2, 3};
      int i = 0;
      while (i &lt; 4) {
          if(!isitright(i)) {
              arr[i] = arr[i+1];
          }
          i++;
      }
  }
  </code></pre>