Well, I managed to get a hold of the code I've been using on my laptop, here's a snippet (it's way too damn long):
Code:
struct usrC
{
string name;
int byCaps;
int byFlood;
int byLength;
string lastmsg;
int lasth;
int lastm;
int lasts;
};
std::vector <usrC> usuario;
Inside main I do:
Code:
usuario.push_back(usrC());
cout << "Size: " << usuario.size() << endl;
usuario[0].name="jajaa";
cout << "Name: " << usuario[0].name << endl;
This works ok, it returns 1 as expected and should, but if I do the same thing in a function:
Code:
int findUser(){
cout << "Size 2: " << usuario.size() << endl;
return -1; // random return for this example's sake
}
It returns 6... why? there's only one occurrence of push_back for the vector in the whole code... I've tried to use structs and classes with no avail :/...
By the way Bubba, it's actually a chat bot for controlling a game chat channel, similar to an IRC bot, but it keeps track of the users, their sanctions and such.