两字符串每个字符比较

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
using namespace std;
char word[5]="?ate";

for(char ch='a';strcmp(word,"mate");ch++)
{
cout<<word<<endl;
word[0]=ch;
}
cout<<"After loop ends.word is "<<word<<endl;
return 0;
}

posted @ 2013-02-27 15:21  徐耀湘  阅读(168)  评论(0编辑  收藏  举报