Skip to content

Instantly share code, notes, and snippets.

@nongiach
Created February 2, 2017 16:47
Show Gist options
  • Save nongiach/26908e2ac9761b66d811d07d43af5a3a to your computer and use it in GitHub Desktop.
Save nongiach/26908e2ac9761b66d811d07d43af5a3a to your computer and use it in GitHub Desktop.
#include <stdio.h>
void split(char *bigbuffer, int bufSize) {
int index = 0;
while (index < bufSize) {
bigbuffer[index + 5] = 0;
printf("%s\n", bigbuffer + index);
printf("---- separation ---\n");
index += 6;
}
}
int main(int argc, char *argv[])
{
char bigbuffer[] = "aaaaa\naaaab\naaaac\n";
split(bigbuffer, sizeof(bigbuffer));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment