Search
 
SCRIPT & CODE EXAMPLE
 

CPP

vector with pinter cout c++

#include <iostream>
#include <vector>

using std::cout; using std::cin;
using std::endl; using std::string;
using std::vector;

template<typename T>
void printVectorElements(vector<T> *vec)
{
    for (auto i = 0; i < vec->size(); ++i) {
        cout << vec->at(i) << "; ";
    }
    cout << endl;
}

int main() {
    vector<string> str_vec = {"bit", "nibble",
                              "byte", "char",
                              "int", "long",
                              "long long", "float",
                              "double", "long double"};

    printVectorElements(&str_vec);

    return EXIT_SUCCESS;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ directory listing 
Cpp :: is javascript for websites only 
Cpp :: c++ reverse vector 
Cpp :: how to iterate through a map in c++ 
Cpp :: jupyter lab use conda environment 
Cpp :: how to use winmain function 
Cpp :: messagebox windows 
Cpp :: for vector c++ 
Cpp :: Runtime Error: Runtime ErrorBad memory access (SIGBUS) 
Cpp :: 2114. Maximum Number of Words Found in Sentences leetcode solution in c++ 
Cpp :: print hello world c++ 
Cpp :: c++ pause 
Cpp :: angle to vector2 godot 
Cpp :: multiply image mat by value c++ 
Cpp :: C++ Area of Scalene Triangle 
Cpp :: C++ Fahrenheit to Celsius 
Cpp :: filling dynamic array with a specific value in c++ 
Cpp :: cuda constant memory initialisation 
Cpp :: c++ default array value not null 
Cpp :: reverse an array using pointers in c++ 
Cpp :: c++ remove whitespace from string and keep the same size 
Cpp :: c++ file to string 
Cpp :: arduino led code 
Cpp :: how to open and print in a file in c++ 
Cpp :: how to hide the c++ console 
Cpp :: maximum value in map in c++ 
Cpp :: string input with space c++ stl 
Cpp :: C++ convert integer to digits, as vector 
Cpp :: wine linux 
Cpp :: cpp case 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =