Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- char *strdiff(char *s1,char *s2);
- int main(){
- int i;
- char text1[]="Hello",text2[]="Henry";
- for(i=0;i<5;i++){
- *strdiff(&text1[i],&text2[i]);
- }
- for(i=0;i<5;i++){
- printf("%c",text1[i]);
- }
- return 0;
- }
- char *strdiff(char *s1,char *s2){
- printf("%c %c\n",*s1,*s2); //test input
- if(*s1!=*s2){
- *s1 = 'X';
- return s1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment