은 code :: blocks에서 .cpp를 열려고 시도했습니다. 오류의 몇 줄을 얻었다std :: string {aka std :: basic_string <char>} '대입의'char * '로 |
부분 코드 : 나는 라인이 오류를받을
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);
}
}
x = List[(Left+Right)/2];
'표준 : : 문자열 {일명 표준 : : basic_string}'로 변환 할 수 없습니다 'char *' 과제에서 |
가능 중복 된 [I가 문자 유형의 배열에 표준 : 기본 \의 _string 형식을 변환 할 수 있습니까?] (http://stackoverflow.com/questions/12978201/how-can-i-convert -a-stdbasic-string-type-of-char-type) – kfsone
[사전 식 비교] (http://en.cppreference.com/w/cpp/string/basic_string/operator_cmp)를 사용하지 않는 이유는 무엇입니까?)'std :: string'에 대한 연산자? –