Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char **args = NULL;
- args = malloc(sizeof(char *) * LINE_LENGTH);
- bool parse_line(char *line, char **arr) {
- size_t i = 0;
- char *point;
- point = strtok(line, " ");
- while (point != NULL) {
- arr[i] = malloc(strlen(point) + 1);
- strcpy(arr[i], point);
- point = strtok(NULL, " ");
- i++;
- }
- arr[i] = NULL;
- if (!arr)
- return false;
- return true;
- }
Add Comment
Please, Sign In to add comment