Splitting an array into two in C
<p>I am trying to convert some binary code into assembly, but as part of the task, I'm not sure how to get the last 5 elements(of 8) in the array into a new array. As you can see I've managed to created an array for the opCode(the first 3 elements), but am not sure how to get the operand into a new array or edit the initial one. </p>

<p>All help is appreciated.</p>

<pre><code>void convert_to_assembly(char bin[])
{
  int i;
  printf("The binary code before spiliting is: ");
  char binary[9] = {'1','0','1','1','1','1','1','0'};
  for(i=0;i&lt;=7;i++)
  {
    printf("%c",binary[i]);
  }
  printf("\n");

  char opCode[4];
  strncpy(opCode,binary,3);
  printf("opcode: "); 
  for(i=0;i&lt;3;i++)
  {
    printf("%c",opCode[i]);
  }
  printf("\n");
}
</code></pre>

<p><strong>Output</strong></p>

<pre><code>The binary code before splitting is: 10111110
opcode : 101
operand: ???????
</code></pre>