vector types (quick)
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)?
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
Popular Topics
Advertisement