URGENT HELP PLEASE ^^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 ifstream read("hello.txt");
      
      string name;
      
      const char * c = name.c_str();

      
      getline(read,name);
      
      cout<<name;
      
      
      
      char delims[] = ",";
      char *result = NULL;
      result = strtok(name.c_str(),delims);



HELP ME PLEASE IT SAYS cant convert const char to char help me to convert badly need thanks and GODBLESS YOU GUYS
A char is 1 character, while a string is 1 or more characters, so that is why it is an error.

On line 5 you are trying to assign a string to a char.
Last edited on
thanks man solved
Topic archived. No new replies allowed.