Search
 
SCRIPT & CODE EXAMPLE
 

CPP

cpp print vector

for(int i = 0; i < vec.size(); i++)
    std::cout << vec[i] << ' ';
Comment

print vector

#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 << ' ';
    }
}
Comment

print vector of vector c++

for (int i = 0; i < vec.size(); i++)
{
    for (int j = 0; j < vec[i].size(); j++)
    {
        cout << vec[i][j];
    }
}
Comment

print all elements of vector c++

for (auto i: vector)
    std::cout << i << ' ';
Comment

print vector c++

std::vector<char> path;
// ...
for (char i: path)
    std::cout << i << ' ';
Comment

PREVIOUS NEXT
Code Example
Cpp :: latex table landscape 
Cpp :: What should main() return in C++? 
Cpp :: bubble sort in c+ 
Cpp :: vector of strings initialization c++ 
Cpp :: Heap pinter c++ 
Cpp :: random number of 0 or 1 c++ 
Cpp :: how to check if a number is prime c++ 
Cpp :: c++ 2d vector assign value 
Cpp :: How to reverse a string in c++ using reverse function 
Cpp :: vector fin element c++ 
Cpp :: c++ multidimensional vector 
Cpp :: segmented sieve cpp 
Cpp :: decltype in c++ 
Cpp :: ray sphere intersection equation 
Cpp :: matrix transpose in c++ 
Cpp :: c++ reference 
Cpp :: divide and conquer based algorithm to find maximum and minimum of an array 
Cpp :: continue c++ 
Cpp :: how to sort a string alphabetically in c++ 
Cpp :: c++ vector initialization 
Cpp :: is power of 2 
Cpp :: filling 2d array with 0 c++ 
Cpp :: sorting vector elements c++ 
Cpp :: c++ if else 
Cpp :: input cpp 
Cpp :: unordered_set to vector 
Cpp :: c++ do every 1 minutes 
Cpp :: insertion sort cpp 
Cpp :: how to delete an element in vector pair in cpp 
Cpp :: hello c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =