Untitled
public text v1 · immutable#include "stdio.h"
#include "stdlib.h"
int main(void)
{
unsigned int n = 0, cur = 0; //current locations
char tok = '.'; //token
char* text = "my magic. tex.t"; //text
char** final; //tokenized text
for (int i = 0; text[i] != '\0'; i++)
{
final[cur][n] = text[i];
n++;
if (text[i] == tok)
{
cur++;
n=0;
}
}
printf("1: %s 2: %s 3: %s", final[0][], final[1][], final[2][]);
system("pause");
return 0;
}