h**l 发帖数: 168 | 1 The following code with function call can shift a string but the code
without function call can not. What might be the problem? Thanks!
_______________________________________________________
void shift(char a[])
{
int i=0;
while(a[i]) a[i] = a[++i];
}
int main()
{
char str[]= "afdd";
shift(str);
cout<
return 0;
}
_____________________________________________________________
int main()
{
char str[]= "afdd";
int i=0;
while(str[i]) str[i] ... 阅读全帖 |
|