title: Splitting char array into chunks quickly c++
body: <p>Is there a faster/ more efficient way to split a char array into chunks (say 21 chars/ array) other than looping over the whole array?</p>
  
  <p>This is my attempt right now</p>
  
  <pre><code>const char* arr = line.c_str();
  char smallArr[(int)ceil((double)strlen(arr)/(double)21)][21];
  int arrSisze[(int)ceil((double)strlen(arr)/(double)21)][1];
  int m=0;int n=0;
  for (int i=0; i&lt;strlen(arr); i++) {
      smallArr[m][i]=arr[i];
      arrSisze[m][0]=(i+1)-n;
      if ((i-n)==19) {
          m++;
          n+=20;
      }
  }
  </code></pre>