title: C - Copy a char into a char*
body: <p>I got some troubles while I'm trying to set a char into a char* ("string")</p>
  
  <p>I got lines, which is all the txt lines I fetched before, and now I'm trying to assign a char to my char*, to filter it.</p>
  
  <p>Here is my actual code :</p>
  
  <pre><code>void TreatDatas(char** lignes, int sizeLignes){ // all the lines, and the size of it.
      char** finalArray;
      finalArray = malloc(2048 * sizeof(char*));
      int sizeOfFinalArray = 0;
  
      int i;
      int j;
  
      char* s;
      char* savedCurrentString = "";
      int sizeOfCurrentString = 0;
  
      for (i = 0; i&lt; sizeLignes; i++){
          s = lignes[i];
          for (j = 0; j &lt; strlen(s); j++){ // I don't pass the first condition the first loop
              if (s[j] == ',' || s[j] == '.' || s[j] == ' ' || s[j] == '\n' || s[j] == ';' || s[j] == ':'){ // Separators list
                  finalArray[sizeOfFinalArray] =  malloc(strlen(savedCurrentString) + 1);
                  strcpy(finalArray[sizeOfFinalArray], savedCurrentString);
                  savedCurrentString = "";
                  sizeOfCurrentString = 0;
              }else{
  
                  printf("%c , %s \n", s[j], savedCurrentString); // L - ""
                  printf("%d", sizeOfCurrentString); // 0
                  strncpy(savedCurrentString, s[j], 1); // error here
  
              }
          }
      }
      free(finalArray);
  }
  </code></pre>