Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. main()
  2. {
  3. char x[20];
  4. char s[20];
  5. strcpy(s,"ste");
  6. strcpy(x,"ven");
  7.  
  8. int i;
  9. int j = 0;
  10. for(i = 0; s[i] != '\0'; i++) //this is an empty loop that just finds the end of s
  11. ;
  12.  
  13. while( (s[i] = x[j]) != '\0'){ //i is equal to the element of where ever the null char in s is, adds the beg of j to s
  14. j++;
  15. i++;
  16. }
  17. s[i] = '\0';
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement