Friday, May 21, 2010

String comparision comparing the whole string with a character and replace the matched character with that

//Author Subhasis Nayak(MCA,BBA,G-TECH)
//date:-20-05-2010
/*comparing the whole string with a character and replace the matched character with that  */
#include
#include
int main(){
int i,j;
char str[26];
char spe = ';';
//cin>>str;(this process will take the string untill you give a 'space')
cin.get(str,25);
cout<<"Your string is: "<
for(i = 0;i<26;i++){
    if(str[i] == spe){
        str[i] = '?';
    }
    else{
       }
}
cout<<
getch();
clrscr();
return 0;
}

No comments:

Post a Comment