vector types (quick)

Started by
1 comment, last by snk_kid 18 years, 10 months ago
Can i use a vector to store my own objects in it or must it be int, double etc? How do i do that (if it works)?
Advertisement
Wait, i think i found it. You can don´t you? Then i must´ve done wrong when i tested it in code.
You can store any type except for (constant) references directly:

#include <vector>struct foo {};int main() {  std::vector<foo> v;  v.push_back(foo());}

This topic is closed to new replies.

Advertisement