📌  相关文章
📜  c++ 指向向量的指针 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.836000             🧑  作者: Mango

代码示例1
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!)
}