The*_*ing 0 c++ arrays syntax stdvector
将向量分配给数组时,为什么我的大小会发生变化?
cout << endl << vertices.size() << endl; //outputs correct number-> 89473
GLfloat* Vertices = &vertices[0];
GLfloat* Colors = &colors[0];
cout << endl << sizeof(Vertices) << endl; //outputs incorrect number-> 4
Run Code Online (Sandbox Code Playgroud)
我知道我可以循环并单独分配(而不是一行分配),但我只是想知道为什么会这样.