title: what is the better way to use sprintf for multiple inputs?
body: <p>I have more than 50 input to add to buffer and make a string out of it.
  For understanding purpose, lets say.</p>
  
  <p>L1, L2, L3 are structures having multiple variables like</p>
  
  <pre><code>struct L1{
  int a;
  int b;
  int c;
  };
  struct L2{
  int l;
  int m;
  };
  struct L3{
  int p;
  int q;
  int r;
  int s;
  };
  </code></pre>
  
  <p>.</p>
  
  <pre><code>sprintf(buffer, "%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d",time, pDeviceMO-&gt;getName(), L1.a, L1.b, L2.l, L3.q, L3.s, L2.m, L3.p, L3.r, L1.c);
  </code></pre>
  
  <p>than write buffer to a File.</p>
  
  <pre><code>fprintf(File, "%s,%s\n",deviceSerialNum, buffer);
  </code></pre>
  
  <p>is there a better way?</p>
  
  <p>Maybe like multiple sprintf for each input. (from a better coding perspective)</p>