Sha256: c87ecd5fb8e7f35bb54f732ca47492a3e3af66ffd3c39362e140012b5b5fdbc4
Contents?: true
Size: 755 Bytes
Versions: 240
Compression:
Stored size: 755 Bytes
Contents
#include <stdlib.h> #include <string.h> #include <stdio.h> #include "series.h" SeriesResults_t series(char *inputText, unsigned int substringLength) { int substringCount = strlen(inputText) - (substringLength - 1); SeriesResults_t results; memset(&results, 0, sizeof(results)); if ((substringCount > 0) && (substringLength > 0)) { results.substringCount = substringCount; results.substring = malloc(sizeof(char *) * substringCount); for (int index = 0; index < substringCount; index++) { results.substring[index] = malloc(sizeof(char) * (substringLength + 1)); sprintf(results.substring[index], "%.*s", substringLength, &inputText[index]); } } return results; }
Version data entries
240 entries across 240 versions & 1 rubygems