title: How do I get the string from a character array in C?
body: <p><strong>EDIT:</strong> I understand how strings and memory work in C now, this question was due to bad understanding</p>
  
  <p>I have a char buffer which is 64 elements in size. Data is put into it by another function. I want to get all elements of the array which doesn't equal null.</p>
  
  <p>To explain it better, here is an example (pseudocode)</p>
  
  <pre><code>char[5] data;
  data[0] = 'c';
  data[1] = 'a';
  data[2] = 't';
  data[3]; // = null 
  getString(data); // Should return "cat" 
  </code></pre>