🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Are script-class member variables initialized automatically?

Started by
0 comments, last by ThyReaper 10 years, 3 months ago

If I have a script class which has member variables which are handles to app-registered types, and I don't explicitly initialize them in the declaration or in the ctor, should they be automatically initialized to null?

For example:


class MyScriptClass
{
    private MyAppClass@ someHandle;
}

Thank you.

Advertisement

Handles are default-initialized to null. Other primitives are not default initialized. All other types use their default constructor, which could also be no initialization for POD types registered by the application.

This topic is closed to new replies.

Advertisement