Search
 
SCRIPT & CODE EXAMPLE
 

CPP

tuple vector c++

#include <bits/stdc++.h>
using namespace std;
int main() {
    typedef vector< tuple<int, int, int> > my_tuple;
    my_tuple tl; 
    tl.push_back( tuple<int, int, int>(21,20,19) );
    for (my_tuple::const_iterator i = tl.begin(); i != tl.end(); ++i) {
        cout << get<0>(*i) << endl;
        cout << get<1>(*i) << endl;
        cout << get<2>(*i) << endl;
    }
    cout << get<0>(tl[0]) << endl;
    cout << get<1>(tl[0]) << endl;
    cout << get<2>(tl[0]) << endl;

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ array pointer 
Cpp :: kmp algorithm c++ 
Cpp :: iostream c++ 
Cpp :: overload array operator cpp 
Cpp :: exponent of x using c c++ 
Cpp :: cpp execute command 
Cpp :: find pair with given sum in the array 
Cpp :: C++ Pi 4 Decimal 
Cpp :: c++ uint8_t header 
Cpp :: fill vector with zeros c++ 
Cpp :: prevent copy c++ 
Cpp :: 1768. Merge Strings Alternately leetcode solution in c++ 
Cpp :: print fps sfml 
Cpp :: c++ unittest in ros 
Cpp :: flutter single instance app 
Cpp :: struct node 
Cpp :: minheap cpp stl 
Cpp :: cin does not wait for input 
Cpp :: cyclically rotate an array by once 
Cpp :: async multi thread 
Cpp :: c++ sorting and keeping track of indexes 
Cpp :: c++ pointers and arrays 
Cpp :: merge sort in descending order c++ 
Cpp :: javascript if else exercises 
Cpp :: c++ last element of vector 
Cpp :: c++ visual studio 
Cpp :: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope 
Cpp :: Common elements gfg in c++ 
Cpp :: 1822. Sign of the Product of an Array leetcode in c++ 
Cpp :: binary to int c++ bitset 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =