In my game, i use a list for my entities, among other things.
my first question is... is it possible to declare an extern list? i want to be able to access my list of entities from anywhere in my code (including other source files). example...
in main.cpp....
in say, weapons.h....Code:list <CBaseEntity *> entities; blalbbllah blahblah blah
and now in weapons.cpp.....Code:extern ????????? entities;
Code:object_thingy *object = new Object(); entities.push_back(object);
and finally my second question, how would i go about getting the total number of elements in a list? for example, i want to check if a list contains over 200 elements, and then delete everything past 200 to save on memory.