#include
#include
void MakeSentenceExcited(char* sentenceText) {
char *p=sentenceText;
while(*p!='\0')
{
if(*p='.')
*p='!';
}
}
int main(void) {
const int TEST_STR_SIZE = 50;
char testStr[TEST_STR_SIZE] = "";
strcpy(testStr, "Hello. I'm Miley. Nice to meet you.");
MakeSentenceExcited(testStr);
printf("%s", testStr);
return 0;
}
void MakeSentenceExcited(char* sentenceText) {
int len = strlen(sentenceText);
int i;
for(i=0;iif(sentenceText[i] == '.')
sentenceText[i] = '!';
}
}
看不出来,你运行了输出的是啥?