1 #include "Cube.h"
2 using cs225::Cube;
3
4 int main() {
5 Cube *c1 = new Cube();
6 Cube *c2 = c1;
7 c2->setLength( 10 );
8 return 0;
9 }
This is the code I am working with, is there anything wrong with it? Does line 7 correctly assign the length of 10 to the cube object, or will it return a compiler error. Because my understanding is that the arrow operator will point c2 to c1, but c1 is still a pointer so shouldn't there needs to be ->-> in order to reach the cube object that contains the functions?