Skip to content

Instantly share code, notes, and snippets.

@pskrgag
Created September 2, 2021 18:50
Show Gist options
  • Save pskrgag/e930fac035c875673ff99d5b36fb7771 to your computer and use it in GitHub Desktop.
Save pskrgag/e930fac035c875673ff99d5b36fb7771 to your computer and use it in GitHub Desktop.
maks.c
#include <string.h>
#include <stdio.h>
int main(void)
{
char test_xuy[] = {"a\nb\nc\nmaks\n"}, *tmp_ptr;
size_t curr_off = 0;
char tmp_buf[1024] = {0x00};
tmp_ptr = strtok(test_xuy, "\n");
while (tmp_ptr) {
strcpy(tmp_buf, tmp_ptr);
printf("%s\n", tmp_buf);
tmp_ptr = strtok(NULL, "\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment