title: How to use sprintf to append array of uint_64 type to an array of char?
body: <p>I want to append the data in <code>ID[10]</code> to <code>dispvar</code> using sprintf. But the problem is that ID is of <code>uint64_t</code> type and <code>dispvar</code> is of type <code>char</code>. So when I try the below code, I get only the first value stored in <code>ID</code> appended to <code>dispvar</code>. How can I append the entire content of <code>ID</code> to <code>dispvar</code>? </p>
  
  <pre><code>char dispvar[150]={0};
  
  union Device_Details{
      struct DeviceDetails{
          uint64_t FirmwareID[10];
          uint64_t No_of_Mot;
          uint64_t ID[10];
          uint64_t RTC_Data[7];
          uint64_t BatStat;       
      }Device;
      uint64_t Buffer[11];
  }DeviceData;
  
  sprintf(dispvar,"\n Device ID is %s", ( char *)ID);
  </code></pre>
  
  <p>ID is set from my app, so if I set ID as Hello from my app, ID will look like - ID[0]='H',ID[1] = 'e',ID[2] = 'l', ID[3] = 'l', ID[4] = '0'; each of them is index of unsigned long long type.</p>
  
  <p><a href="https://i.stack.imgur.com/ZkReg.jpg" rel="nofollow noreferrer">IMAGE</a></p>