Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char ac_auto_lvalue[] = "<deb>kabosu lul u</deb>";
- // Adding 7 to compensate for the length of "GROUP: "
- const char *p1 = strstr(ac_auto_lvalue, "<deb>")+5;
- const char *p2 = strstr(p1, "</deb>");
- size_t len = p2-p1;
- char *res = (char*)malloc(sizeof(char)*(len+1));
- strncpy(res, p1, len);
- res[len] = '\0';
- printf("'%s'\n", res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement