title: C: create String existing out of ints and chars
body: <p>Since I'm very new to C programming, I have a probably very simple problem.</p>
  
  <p>I got a struct looking like this</p>
  
  <pre><code>typedef struct Vector{
      int a;
      int b;
      int c;
  }Vector;
  </code></pre>
  
  <p>Now I want to write an array of Vectors in a file. To achieve that, I thought to create following method scheme</p>
  
  <pre><code>String createVectorString(Vector vec){
      // (1)
  }
  
  String createVectorArrayString(Vector arr[]){
      int i;
      String arrayString;
      for(i=0; i&lt;sizeof(arr); i++){
          //append createVectorString(arr[i]) to arrayString  (2)
      }
  }
  
  void writeInFile(Vector arr[]){
      FILE *file;
      file = fopen("sorted_vectors.txt", "a+");
      fprintf(file, "%s", createVectorArrayString(arr);
      fclose(file);
  }
  
  int main(void){
  
      // create here my array of Vectors (this has already been made and is not part of the question)
      // then call writeInFile
  
      return 0;
  }
  </code></pre>
  
  <p>My main problems are at (1), which involves also (2) (since I have no clue how to work with Strings in C, eclipse is saying "Type "String" unknown", although I included <code>&lt;string.h&gt;</code>)</p>
  
  <p>So I read at some point that transforming an int to a String is possible with the method itoa().
  As I understood it, I can simply do following</p>
  
  <pre><code>char buf[33];
  int a = 5;
  itoa(a, buf, 10)
  </code></pre>
  
  <p>However, I cannot bring that to work, let alone that I can't figure out how to "paste" <code>char</code>s or <code>int</code>s into a String.</p>
  
  <p>In my point <strong>(1)</strong>, I would like to create a String of the Form <code>(a,b,c)</code>, where as a, b and c are the "fields" of my struct Vector.</p>
  
  <p>In point <strong>(2)</strong>, I would like to create a single String of the Form <code>(a1,b1,c1)\n(a2,b2,c2)\n...(an,bn,cn)</code>, whereby n is the amount of Vectors in the array.</p>
  
  <p>Is there a quick solution? Do I confuse the concept of Strings from Java with them of C?</p>