Game Development Community

Changing a constant

by Erik Madison · in Torque Game Engine · 03/26/2004 (3:20 pm) · 3 replies

Basic coding question, I can't seem to remember how to do this....

TSShape const* mShape= object->getShape();

mShape->objects[i].xxxxxx = true;

error: L-value specifies const object.

I really need to set xxxxxxx (super secret value :)) from within code.

#1
03/26/2004 (3:57 pm)
You can't change a constant. Its a constant :)

Constants allow the compiler to optimze the variable because it is guarunteed not to change.
#2
03/26/2004 (4:10 pm)
Okay. I'm finding another area and method for implementing this variable.
#3
03/26/2004 (4:11 pm)
Well if you don't need it to be a constant just remove the const keyword.