how to append an element to an array in cpp

C++
std::vector<std::string> x = {"a", "b", "c"};
x.push_back("d");
Source

Also in C++: