Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // version 1
- void strmcpy(char *t, int m, char *s) {
- t = t + m - 1;
- while (*t != '\0')
- *s++ = *t++;
- *s = '\0';
- }
- // version 1
- void strmcpy(char *t, int m, char *s) {
- if(m<=MAXN){
- t = t + m - 1;
- while (*t != '\0')
- *s++ = *t++;
- }
- *s = '\0';
- }
- // ...
- 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