求大神帮忙改一下错
实现函数将若干个字符串中字符元素移位输出,例如a变成z,b变成a,c变成b,依此类推,移位规则可以自定义。#include <stdio.h>
#include<string.h>
int main(void){
void print(char *b);
char a[]="i love china";
char *b=a;
print(b);
printf("%s",a);
return 0;
}
void print(char *b){
int i;
for(i=0;b[i]!='\n';i++)
if(b[i]=='z')
b[i]='a';
else if(b[i]==' ')
b[i]=' ';
else
b[i]=b[i]+1;
}