I have function like this
typedef vector<vector<string> > vecArray;
vecArray dul();
vecArray dul() {
vecArray arr = {
{ "a", "b", "c" },
{ "a", "b", "c" },
{ "a", "v", "d" }
};
return arr;
}
i want to return look like bellow string in C++ function
{
{"ffsff","aaaasda","ddaddd"},
{"sfsasda","sdadsfd","asasaad"},
{"adacv","fasfaa","asa","aba"}
}
You can’t construct a vector with an initializer list, as that feature is only available in C++11. You can, with ease though, construct the vector using a 2D array.