C++ keeps everything you learned in C and adds types that manage their own memory. std::string holds text and knows its length; + joins strings and == compares their text. std::vector<int> is a growable array that frees itself: v.size() is its length, v.push_back(x) appends, and v[i] indexes.
The range for loop, for (int x : v), visits every element without an index. Functions usually take these types as const std::vector<int>&, a reference that avoids copying the whole vector, and return them by value, which C++ makes cheap.
Include <string> and <vector>, and write the std:: prefix. A function that builds a new vector starts with an empty one and calls push_back.
A range for over a vector, and a string built with + and std::to_string.