Public feed #892781

Miscellany

public c v1 · immutable
Raw Edit
·published 2008-02-05 18:31 UTC
rendered paste body
#include <stdio.h>#include <string.h>#include <unistd.h>int main(int argc, char *argv[]) {    const char *delims = " []";    char *buf;    char *x, *tok;    buf = (char *) malloc(256);    strcpy(buf, "this is a [test ]boo hehe");    x = buf;    do {        tok = strsep(&x, delims);        printf("tok:[%s]\n", tok);    } while (x != NULL);    return 0;}