Code Snippet: string split in c++ (c syntax)

Below code snippet useful while splitting string (char*) .   #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> int split (const char *str, char c, char ***arr) { int count = 1; int token_len = 1; int i = 0; char *p; char *t; p = str; while (*p != '\0') { if (*p == … Continue reading Code Snippet: string split in c++ (c syntax)

Advertisements