vector of string in c++
C++
// C++ program to demonstrate vector of strings using
#include <bits/stdc++.h>
using namespace std;
int main()
{
// Declaring Vector of String type
vector<string> colour;
// Initialize vector with strings using push_back
// command
colour.push_back("Blue");
colour.push_back("Red");
colour.push_back("Orange");
colour.push_back("Yellow");
// Print Strings stored in Vector
for (int i = 0; i < colour.size(); i++)
cout << colour[i] << "\n";
}
Also in C++:
- Title
- maximum subarray sum equal with K in c++
- Category
- C++
- Title
- multiset c++
- Category
- C++
- Title
- declaring 2d vector in c++
- Category
- C++
- Title
- sub string of vector c++
- Category
- C++
- Title
- create a dictionary cpp
- Category
- C++
- Title
- modular exponentiation c++
- Category
- C++
- Title
- how to delete an element in vector pair in cpp
- Category
- C++
- Title
- c++ modulo make it give only positive numbers
- Category
- C++
- Title
- knapsack
- Category
- C++
- Title
- compare string c++
- Category
- C++
- Title
- self in c++
- Category
- C++
- Title
- c++ random numbers
- Category
- C++
- Title
- primeros numeros primos
- Category
- C++
- Title
- c++ for loop syntax
- Category
- C++
- Title
- getch c++ library
- Category
- C++
- Title
- c++ how to add something at the start of a vector
- Category
- C++
- Title
- c++ cli convert string to string^
- Category
- C++
- Title
- array search c++
- Category
- C++
- Title
- c++ isalphanum
- Category
- C++
- Title
- hohw toparse a string in c++
- Category
- C++
- Title
- capitalize first letter c++
- Category
- C++
- Title
- print matrix c++
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- c++ read matttrix from text file
- Category
- C++
- Title
- first prime numbers
- Category
- C++
- Title
- fast input output in c++
- Category
- C++
- Title
- kruskal's algorithm c++ hackerearth
- Category
- C++
- Title
- how to print a string to console in c++
- Category
- C++
- Title
- ue4 c++ overlapping functions cpp setup
- Category
- C++
- Title
- deque c++
- Category
- C++
- Title
- Combination Sum
- Category
- C++
- Title
- How to check if a triangular cycle exists in a graph
- Category
- C++
- Title
- queue c++
- Category
- C++
- Title
- c++ variable argument
- Category
- C++
- Title
- c++ char print align
- Category
- C++
- Title
- how to sort in descending order c++
- Category
- C++
- Title
- c++ get ascii value of char
- Category
- C++
- Title
- c++ clear stream
- Category
- C++
- Title
- c++ formatting
- Category
- C++
- Title
- compile c++ linux
- Category
- C++
- Title
- C++ and endl
- Category
- C++
- Title
- conditional operator in cpp
- Category
- C++
- Title
- restting a queue stl
- Category
- C++
- Title
- count a character in a string c++
- Category
- C++
- Title
- remove value from vector c++
- Category
- C++
- Title
- c++ initialization list
- Category
- C++
- Title
- merge sort in c++
- Category
- C++
- Title
- file objects in c++
- Category
- C++
- Title
- #include
- Category
- C++
- Title
- built in function in c++ for binary to decimal
- Category
- C++
- Title
- how to use wasd c++
- Category
- C++
- Title
- how to get os name in c++
- Category
- C++
- Title
- how initilaize deffult value to c++ class
- Category
- C++
- Title
- pairs in c++
- Category
- C++
- Title
- what does map.count() return in c++
- Category
- C++
- Title
- c++ template function
- Category
- C++
- Title
- min heap declaration in c++ stl
- Category
- C++
- Title
- Qt asynchronous HTTP request
- Category
- C++
- Title
- c++ program to find gcd of 3 numbers
- Category
- C++
- Title
- mkdir boost filesystem
- Category
- C++
- Title
- memcmp in cpp
- Category
- C++
- Title
- placement new c++
- Category
- C++
- Title
- c++ unittest in ros
- Category
- C++
- Title
- c++ ternary operator
- Category
- C++
- Title
- how to append one vector to another c++
- Category
- C++
- Title
- file format not recognized treating as linker script c++
- Category
- C++
- Title
- elseif c++
- Category
- C++
- Title
- cout value c++
- Category
- C++
- Title
- how to grab all of user input c++
- Category
- C++
- Title
- c++ vector iterator
- Category
- C++
- Title
- initialising 2d vector
- Category
- C++
- Title
- set of vectors c++
- Category
- C++
- Title
- while loops
- Category
- C++
- Title
- c++ vector pop_back
- Category
- C++
- Title
- substr in c++
- Category
- C++
- Title
- input a string in c++
- Category
- C++
- Title
- centos7 mlock2
- Category
- C++
- Title
- C++ If
- Category
- C++
- Title
- bfs in C++
- Category
- C++
- Title
- dfs in c++
- Category
- C++
- Title
- 2d vector
- Category
- C++
- Title
- checking an int in c++
- Category
- C++
- Title
- c++ reset stream
- Category
- C++
- Title
- iterate through unordered_map c++ in reverse order
- Category
- C++
- Title
- stack function in cpp
- Category
- C++
- Title
- c++ char to string
- Category
- C++
- Title
- opperanf >> c++
- Category
- C++
- Title
- euler's totient function c++
- Category
- C++
- Title
- c++ typedef
- Category
- C++
- Title
- registering a new QML type
- Category
- C++
- Title
- root to leaf path print
- Category
- C++
- Title
- case label in c++
- Category
- C++
- Title
- stringstream in c++
- Category
- C++
- Title
- retu7rn this c++
- Category
- C++
- Title
- how to convert n space separated integers in c++
- Category
- C++
- Title
- find in string c++
- Category
- C++
- Title
- can we compare a long long int with int in c++ using max or min functions
- Category
- C++
- Title
- run cmd command c++
- Category
- C++
- Title
- c++ string to stream
- Category
- C++
- Title
- rosrun actionlib_msgs genaction.py
- Category
- C++