0

On my header file I have my MDA variable:

class node : public MPxNode {

public:

    static MDoubleArray mDA;
};

Then on my .cpp file I see this line again:

MDoubleArray node::mDA;
  • Is this line on the .cpp needed?
  • 2
    The line `static MDoubleArray mDA;` in the class is just a *declaration*. It tells the compiler that this variable exists, and what its type is. It doesn't actually create the variable or its memory. But `MDoubleArray node::mDA;` in the source file is a *definition*. It tells the compiler to actually create the variable, and make sure there's memory allocated for it. Any decent book, tutorial or class should have that information. – Some programmer dude May 05 '23 at 20:01

0 Answers0