Guest User

Untitled

a guest
Jan 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. // version 1
  2. void strmcpy(char *t, int m, char *s) {
  3. t = t + m - 1;
  4. while (*t != '\0')
  5. *s++ = *t++;
  6. *s = '\0';
  7. }
  8.  
  9. // version 1
  10. void strmcpy(char *t, int m, char *s) {
  11. if(m<=MAXN){
  12. t = t + m - 1;
  13. while (*t != '\0')
  14. *s++ = *t++;
  15. }
  16. *s = '\0';
  17. }
  18.  
  19. // ...
  20. void strmcpy(char*t,int m,char*s){for(int i=0;;i++,t++)if(!*t){*s=0;break;}else if(i>m-2)*s++=*t;}
Add Comment
Please, Sign In to add comment