title: Not able to initialize the array in sequence, in-order to avoid the verbosity of code
body: <p>Not able to initialize the array in sequence. Actually, I want to construct the message with the length of 64. providing 64 array indexes, the code looks longer and verbose. I want to do it in sequence in order to avoid verbosity.</p>
  
  <hr>
  
  <p>But I initialized an array like this <code>buf[]</code>  and I tried as <code>buf[6]</code>  also that didn't work either.</p>
  
  <pre><code>error: expected expression before ‘]’ token
  </code></pre>
  
  <p>Does anyone tell how to do it? Isn't it possible in C to initialize an array in different line not at declaration?</p>
  
  <hr>
  
  <p>ARRAY_SIZE just give the count of array indexes.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>void a_test(char in) {
  
      uint8_t buf[256];
      int i;
  
      char cmd = in;
  
      if (cmd == 'a') {
          // it doesn't work like this 
          buf[] = { 0xfe, 0xb0, 0x01, 0x22, 0x00, 0x00};
  
          /* it works like this
          buf[0] = 0xfe;
          buf[1] = 0xb0;
          buf[2] = 0x01;
          buf[3] = 0x22;
          buf[4] = 0x00;
          buf[5] = 0x00; */
      }
  
  
      if (cmd == 'b') {
          buf[] = { 0x44, 0xb0, 0x01, 0x03, 0x00};
      }
  
  
      for (i = 0; i &lt; ARRAY_SIZE(buf); i++) {
          printf("%02x ", buf[i]);
      }
  }
  
  int main() {
    a_test('a');
    return 0;
  }
  </code></pre>