Converting one character into another
Hello Guys
I want to convert one character into another
e.g.
array[10] has 10 characters like abcdefghij
now I want to change all the a's in array into z's
how can I do that
here's an example code
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
using namespace std;
int main() {
char arr[10],s[10],a="s",b="y";
cin>>arr[1];
if(arr[1]==a) s[1]=b;
cout<<s[1];
return 0;
}
|
Thanks
Last edited on
Topic archived. No new replies allowed.