hello, guys, i am very new to c++. i have just wrote this class:
class planet
{
public:
float angularSpeed;
float angle;
};
here is a function trying to modify the angle of the object:
void foo(planet* p) {
p->angle = p->angle + p->angularSpeed;
}
planet* bar = new planet();
bar->angularSpeed=1;
bar->angle=2;
foo(bar);
It seem that the angle in bar didn't change at all.