Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
// Including the vector library using namespace std; int main() { // A vector with 3 elements vector
cars = {"Volvo", "BMW", "Ford"}; // Adding another element to the vector cars.push_back("Tesla"); for (string car : cars) { cout << car << "\n"; } return 0; }
Volvo
BMW
Ford
Tesla