title: Trouble loading input into vector type function in C
body: <p>Ive created a vector in C that holds chars. The point is to ask a user for input from keyboard and have them input one char at a time, then add it to the vector using calloc.It currently does not load anything and quits after any input.  I want to be able to keep adding characters until the user inputs return in place of a character then, the program will turn the characters into a string and append to text that is preset. After it will print out the result. My issue is that my program won't load the user input into the vector array. The final result should look like HW4 Input: 123456</p>
  
  <pre><code> #include &lt;stdio.h&gt;
   #include &lt;stdlib.h&gt;
   #include &lt;string.h&gt;
   //declare a new vector structure
  int arraySize =1;
  
  char *vector(char *Array){
      arraySize++;
      void *temp=(char*) calloc(arraySize, sizeof(char));
      Array= (char*) temp;
      return Array;
  }
  
  int main(void){
      int i, m;
      int h=0;
      int index=0;
      char c;
      char *array = (char *) calloc(arraySize, sizeof(char));
      array[0] = '\0';
      char ch[]= "HW4 input: ";
      printf("\nEnter a single character to add to the string\n");
      printf("Enter one character at a time, when done press enter without any other input.\n");
      while((c=getc(stdin))!='\n'){
          array[index]=c;
          index++;
          if(index&lt;arraySize){
              char *temp=(char*) calloc(arraySize, sizeof(char));
              memcpy(temp,array, arraySize);
              array=vector(array);
              memcpy(array, temp, arraySize);
          }
      }
  
      arraySize++;
      array=vector(array);
      index++;
      array[index]='\0';
      char output[arraySize+14];
      for (i=0; i&lt;strlen(ch); i++){
          output[i]= ch[i];
      }
  
      for(m=i; m&lt;strlen(output); m++){
          output[m]=array[h];
      }
  
      printf("\n%c\n", array[0]);
      free(array);
      return 0;
  }
  </code></pre>