I'm trying to assemble lexemes into one character array using concatenation, but some kind of nonsense comes out:
char str[80], str2[80]; scanf("%s", str); cout << "Разделение строки " << str << " на лексемы\n"; char * pch = strtok(str, "Cc"); for (int i=0; pch != NULL; i++) { cout << pch << endl; strcat(str2, pch); pch = strtok(NULL, "Cc"); } strcat(str2, "\0"); system("pause"); return 0;