I used the strcpy() function and it only works if I use C-string arrays like:
char a[6] = "text";
char b[6] = "image";
strcpy
strcpy is only for C strings. For std::string you copy it like any C++ object.
std::string a = "text";
std::string b = a; // copy a into b
If you want to concatenate strings you can use the + operator:
std::string a = "text";
std::string b = "image";
a = a + b; // or a += b;
You can even do many at once:
std::string c = a + " " + b + "hello";
Although "hello" + " world" doesn't work as you might expect. You need an explicit std::string to be in there: std::string("Hello") + "world"