Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include <iostream> #include <stack> using namespace std; int main() { // Create a stack of strings called cars stack<string> cars; // Add elements to the stack cars.push("Volvo"); cars.push("BMW"); cars.push("Ford"); cars.push("Mazda"); // Get the size of the stack cout << cars.size(); return 0; }
4