代码:
#include<stdio.h>
int main()
{
char str[]="a1a2a3a4";
int i=0;
while(*(str+i))
if(*(str+i++)=='a')str[i-1]='b';
puts(str);
return 0;
}
输出结果:
b1b2b3b4
--------------------------------
Process exited with return value 0
Press any key to continue . . .