Search:
Forum
General C++ Programming
Vector <int , 2> i
Vector <int , 2> i
Jan 12, 2012 at 11:02pm UTC
bruice
(6)
As we all know, vector is a kind of sequence container. there are declared like that:
vector<type> variable_name (number_of_elements);
however, I saw a program declared a vector like that:
vector <int ,2> i
so what's the mean? how to explain the number 2?
thank you
Jan 12, 2012 at 11:05pm UTC
Cubbi
(4774)
Sounds like a typo from array, as in
std::array<
int
, 2> i;
, in which case 2 is the number of elements in the array, or this could be someone's personal (not std::) vector class that has similar (or different) semantics.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs