Вот мой код:
void reverseStr(char *str)
{
if (str == NULL) return;
int i=0, j=strlen(str) -1;
while(i<j)
{
char temp = str[j]; //i think this is the cause of the problem
str[j] = str[i];
str[i] = temp;
i++;
j--;
}
}
Вот где это называется:
int main()
{
char *str = "Forest Gump";
reverseStr(str);
cout << str;
}
Вот моя ошибка:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/C.tmbundle/Support/bin/bootstrap.sh: строка 7: 1931 Ошибка шины "$ 3" .out
Есть предположения? Заранее спасибо.
reverseStr
. - person CB Bailey   schedule 17.08.2010<<
для обозначения чего-либо, кроме сдвига влево. - person nmichaels   schedule 17.08.2010