📅  最后修改于: 2022-03-11 14:44:50.836000             🧑  作者: Mango
int main(int nArgs, char ** vArgs)
{
vector *v = new vector(10);
v->at(2); //Retrieve using pointer to member
v->operator[](2); //Retrieve using pointer to operator member
v->size(); //Retrieve size
vector &vr = *v; //Create a reference
vr[2]; //Normal access through reference
delete &vr; //Delete the reference. You could do the same with
//a pointer (but not both!)
}