std::string {aka std::basic_string<char>}' to 'char*' in assignment|

versuchte, Sie zu öffnen .cpp code::blocks. Habe paar Zeilen Fehler

Teilweise code :

void QSort(string List[], int Left, int Right)
{
  int i, j;
  char *x;
  string TEMP;

  i = Left;
  j = Right;
  x = List[(Left+Right)/2];

  do {
    while((strcmp(List[i],x) < 0) && (i < Right)) {
       i++;
    }
    while((strcmp(List[j],x) > 0) && (j > Left)) {
        j--;
    }
    if(i <= j) {
      strcpy(TEMP, List[i]);
      strcpy(List[i], List[j]);
      strcpy(List[j], TEMP);
      i++;
      j--;
   }
  } while(i <= j);

  if(Left < j) {
     QSort(List, Left, j);
  }
  if(i < Right) {
     QSort(List, i, Right);
  }
}

Ich erhalte diese Fehlermeldung in der Zeile

 x = List[(Left+Right)/2];

cannot convert 'std::string {aka std::basic_string}' to 'char*'
in Abtretung|

Schreibe einen Kommentar