Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>;
- #include <stdlib.h>;
- char* replace(char *s, char c1, char c2)
- {
- int i;
- for (i=0; i<10; i++)
- {
- if (s[i]==c1) s[i]=c2;
- }
- return s;
- }
- int main()
- {
- int i;
- char c1='a',c2='b';
- char *pole=(char*)malloc(10*sizeof(char));
- for (i=0; i<10; i++) pole[i]='a';
- pole=replace(pole, c1, c2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement