How do I convert a String to a char

Hello,
I frustred to be blocked with that.
I can nit copy a string to a char

I declare spliedString like this

   // SlitString
    #define NBVALS 9
    char *splitedString[NBVALS];

I have that function

splitString("toto,+345,titi",slitedString)
    void splitString(char *ligne, char **splitedString)
    {
      
      char *p = ligne;
      
      int i = 0;
      splitedString[i++] = p;
      while (*p) {
       
        
        if (*p==',') {
          *p++ = '\0';
          if (i<NBVALS){
             splitedString[i++] = p;
          }
        } 
        else
        {
          p++;
        }
     
      }
      while(i<NBVALS){
        splitedString[i++] = p; 
      }
    }

If I do a for with splitedString display, it display this

    for(int i=0;i<4;i++){
    Serialprint(i);Serial.print(":");Serial.println(splitedString[i]);
    }

    //0:toto
    //1:+4176112233
    //2:14/09/19

I also declared and want to copy..

  char sms_who[15];
    char sms_phone_number[15];
    char sms_data[15];
    //and I want to copy 
    strcpy(sms_who,splitedString[0])
    strcpy(sms_phone_number,splitedString[1])
    strcpy(sms_date,splitedString[2]

)

This generate an error message

strcpy(sms_who,splitedString[0])

sim908_cooking:840: error: invalid conversion from 'char' to 'char*'

while splitedString[0] contain 'toto' and tot is a string in a char?
I know, I am very confused with char and pointer * :o(

How so you think you are going to fit "toto" in a char? A char holds ONE character. The compiler is telling you that what you want to do is impossible. It's right. Live with it.

Now, copying the data to a char ARRAY is a whole different story, and is quite easy.

Hello
But I tried several option

char *c = splitedString[1];
  strcpy(sms_from_number,c);

that generate this

sim908_cooking:841: error: invalid conversion from 'char' to 'char*'
  sprintf(sms_from_number,"%s,splitedString[1])

generate

sim908_cooking:840: error: invalid conversion from 'int' to 'const char*'

:cold_sweat: :cold_sweat: sorry

char *c = splitedString[1];

splitedString (how did you splite a string?) is an array. aplitedString[1] is a char. Why are you trying to store a char in a char pointer?

  sprintf(sms_from_number,"%s,splitedString[1])

There is a " missing from this statement.

Enough with the useless snippets. Post ALL of your code. We can't tell what type your variables are.

I can't imagine why you are using sprintf to copy the data, anyway.

Use

char from[20];
strcpy(from, splitedString[1]);

and be done with it.