For example, I have a code like this.
char NameTmp[] = "foo.txt";
char Name[] = "bar.txt"
char cmd[80] = "./analyzeText ";
strcat(cmd, Name);
strcat(cmd, " ");
strcat(cmd, NameTmp);
strcat(cmd, " ");
strcat(cmd, "8");
system(cmd);
Basically, I am trying to call “./analyzeText bar.txt foo.txt 8” on linux on my program. analyzeText is program already made and is in the same folder.
I’m wondering is there a shorter way than to use “strcat” to make strings in c++?
Use some strings:
It’s slightly less efficient (more strings are created), but it’s much simpler.