for(int i = 0; i < vec.size(); i++)
std::cout << vec[i] << ' ';
#include <vector> // vector
#include <iostream> // cout
using namespace std;
int main()
{
vector<int> tmp = {1,2,3,4,5,6};
for (auto i : tmp) {
cout << i << ' ';
}
}
for (int i = 0; i < vec.size(); i++)
{
for (int j = 0; j < vec[i].size(); j++)
{
cout << vec[i][j];
}
}
for (auto i: vector)
std::cout << i << ' ';
std::vector<char> path;
// ...
for (char i: path)
std::cout << i << ' ';
Code Example |
---|
Cpp :: c++ int main() |
Cpp :: c++ add object to array |
Cpp :: delete one specific character in string C++ |
Cpp :: mkdir c++ |
Cpp :: abs in c++ |
Cpp :: doubly linked list c++ code |
Cpp :: c++ function for checking if a sting is a number |
Cpp :: c++ initialize multidimensional vector |
Cpp :: c++ find_if |
Cpp :: how to iterate throguh a string in c++ |
Cpp :: c++ |
Cpp :: iterate over 2 vectors c++ |
Cpp :: how to add an element to std::map |
Cpp :: on component begin overlap c++ |
Cpp :: size of pointer array |
Cpp :: matrix in vector c++ |
Cpp :: c++ int |
Cpp :: deque c++ |
Cpp :: c++ public class syntax |
Cpp :: C++ Area and Perimeter of a Rectangle |
Cpp :: c++ int to char* |
Cpp :: vector find |
Cpp :: c++ insert into map |
Cpp :: priority queue smallest first |
Cpp :: C++ fill string with random uppercase letters |
Cpp :: Find the biggest element in the array |
Cpp :: sort vector c++ |
Cpp :: double to float c++ |
Cpp :: how to initialize 2d array with values c++ |
Cpp :: c++ range based for loop |