Original Post
Greetings to one and all! I'm having a little problem with using the size() function with a vector (as the name of the thread implies) I'm also quite sure that i have had similar problems with begin() and end() which leads me to the (perhaps stupid) conclusion that the type of vector i'm creating doesnt work. ok, so the problem I have used vectors (and lists, not that thats relevent) elswhere in my code, and even within the same file, with no ill effects. The type i'm trying to store in the vector is a 'LPCSTR', but i have also tried a few other types and acheived the same error. As you may have gathered i'm trying to store filenames (or to put it another way, character strings) so if somebody could point me in the right direction for doing so, that would be a great help. Obviously any other help is greatly appreciated too! Thanks for your time guys! EDIT: i'm going offline now (to bed) so i apologise for my absence if you post a reply. I'm not being ignorant! I'm just not being conscious. [smile] [Edited by - Multiverse on September 21, 2005 10:51:52 AM]
// this is where it gets called. 'm_Filenames' is the name of the vector
for (i = 0; i < m_Filenames.size(); i++)
{
... // code to do with stuff
}
// and the point at which the error occurs whilst debugging, which is in the
// vector include file...
size_type size() const
{return (_First == 0 ? 0 : _Last - _First); }