[CTRL++] Initialize member variable in the constructor
Initializing values in the constructor is faster than setting them afterwards with setter methods or when defining the variable.
struct S(){ //instead of this, use the constructor //private b = calcValue(); private b; public S() { b = calcValue(); }};
Date added:
Last revised:
Hits:
10.793
Rating:
Tags:
Programming / Scripting, OOP