hamaXD

59 2.1

Oct 9th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. char *strdiff(char *s1,char *s2);
  3. int main(){
  4.     int i;
  5.     char text1[]="Hello",text2[]="Henry";
  6.     for(i=0;i<5;i++){
  7.         *strdiff(&text1[i],&text2[i]);
  8.        
  9.     }
  10.     for(i=0;i<5;i++){
  11.         printf("%c",text1[i]);
  12.        
  13.     }
  14.     return 0;
  15. }
  16. char *strdiff(char *s1,char *s2){
  17.     printf("%c %c\n",*s1,*s2); //test input
  18.     if(*s1!=*s2){
  19.         *s1 = 'X';
  20.         return s1;
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment