Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Author: XAgent Smith*/
- #ifndef strtok
- #define TOK "string.h"
- #include TOK
- #endif
- #include<stdlib.h>
- int makeargv(const char *s,const char *delemeter,char ***argvp)
- {
- char *token;
- int i=0;
- *argvp=(char**)malloc(sizeof(char)*strle(s)+8);
- char *ptr=(char*)malloc(sizeof(char)*strle(s)+8);
- copy(ptr, s);
- token=strtok(ptr,delemeter);
- while(token!=NULL)
- {
- *(*argvp+i++)=token;
- token=strtok(NULL,delemeter);
- }
- if(i<=0) return -1;
- return i;
- }
- /***********************************/
Add Comment
Please, Sign In to add comment