title: How can I buffer my data which are read one by one byte and send them as a sequence?
body: <p>I have a GPS module and I can read only one byte at a time from the i2c bus so I am using a loop similar to this (this is an example code):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main (void)
  {
      int i;
      char test[26];
      char sendbuf[40];
      for (i=0;i&lt;26;i++) 
      {
          test[i]=i;
      }
  }
  </code></pre>
  
  <p>I want to send these data all together and not byte to byte.
  Is there any way to put them in a buffer and then send them all at once like:</p>
  
  <pre><code>sprintf(sendbuf, "%s", test);
  </code></pre>
  
  <p><strong>without the use of for(;;)</strong>?</p>