Lets say I have a static array of an object which size cannot change.
struct vector2 { //8 Bytes
float x, y;
};
Does the computer calculate the size every time sizeof
is called or is this stored somewhere? If not, does it have the same performance as it was stored somewhere?
std::cout << sizeof(vector2) << std::endl;
std::cout << sizeof(vector2) << std::endl;
Is this as fast as
Byte sizeOfVector2 = sizeof(vector2);
std::cout << sizeOfVector2 << std::endl;
std::cout << sizeOfVector2 << std::endl;