What is a C++ object of the type vector<char,allocator<char> > and how can it be used? -
i have c++ object of type vector<char,allocator<char> >
. conceptually, expect list of boolean values. how should access (for example, print boolean value of each of elements)?
if able use range for
, can use:
for ( auto el : v ) { // use el }
if still using c++03, can use:
vector<char,allocator<char> >::const_iterator iter = v.begin(); vector<char,allocator<char> >::const_iterator end = v.end(); ( ; iter != end; ++iter ) { char el = *iter; // use el }
Comments
Post a Comment