error: expected primary-expression before 'char'

Hi everyone, i'm having trouble with this program
When i complied, it has an error :error: expected primary-expression before 'char'
char *p=stringsplit(char msg[]);

What should i do to solve this error
Thank you very much
Here is my coe

char *stringsplit(char msg[])
  
{ 
  char *words[10];
   char * p;
  int i = 0;
   char dauphay[] = ",";

  p = strtok(msg, dauphay);
  while(p && i < 10)
  {
    words[i] = p;
    p = strtok(NULL, dauphay);
    ++i;
  }  
  return *words;
} 
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  char msg[]="1,2,3,4";
  char *p=stringsplit(char msg[]); 
}

void loop() {
  // put your main code here, to run repeatedly:

}
  char *p=stringsplit(char msg[]);

should be:

  char *p=stringsplit(msg);

Thank you very much , it worked

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.