I sure as hell that i will recomend you to my friends. I wish that you could be my professor!!!!! :)
@Huffer7 Жыл бұрын
Very well explained!
@dzentsetsu56072 жыл бұрын
Thank you for good tutorial. Have a question. Where is it okay to initialize static variable? Should it be initialized in header or cpp file? And another question is it considered bad practice to make static variable public?
@PortfolioCourses2 жыл бұрын
You're welcome! And great questions too! 🙂 We shouldn't initialize the static variable in the header, this is a good thread as to why: stackoverflow.com/questions/22869788/why-should-i-not-initialize-static-variable-in-header. I've never heard that it's a bad practice to make static variables public, I think it would depend on what they are being used for.
@dzentsetsu56072 жыл бұрын
@@PortfolioCourses 🙏🙏🙏
@stonedcodingtom9097 Жыл бұрын
Very good explanation
@PortfolioCourses Жыл бұрын
Thank you very much for the positive feedback, I'm glad you enjoyed the explanation! :-)
@ValliNayagamChokkalingam Жыл бұрын
Thank you! Private variables cannot be defined/initialized outside the class but private static variables can be initialized outside the class using ::, right?
@PortfolioCourses Жыл бұрын
Yes that's true, though I believe private static variables *must* be initialized outside of the class (though if you really deep drive research it you may find there is some nuance there, I think a couple types of static members can be technically be initialized in the class).