To initialize means assigning an initial state to the object before it is used. This initialization can be part of the instantiation process, in that case values are explicitly assigned to object attributes in the constructor of the object.
To sum up, if the implementation cannot constant initialize it, then it must first zero initialize and then initialize it before any dynamic initialization happends.
} An important thing to remember: at the moment you initialize even one object/variable in the struct, all of its other variables will be initialized to default value. If you don't initialize the values in your struct (i.e. if you just declare that variable), all variable.members will contain "garbage values", only if the declaration is local!
A constructor should initialize an object in a way that it's in a usable state. A constructor should only initialize an object, not perform heavy work. A constructor should not directly or indirectly call virtual members or external code. So in most cases an Initialize method shouldn't be required.
These are just a couple of examples where it isn't strictly necessary to initialize a variable, since it's set later (but not accessed between declaration and initialization). In general though, it doesn't hurt to always initialize your variables at declaration (and indeed, this is probably best practice).
Even though initializing variables in python is not necessary, my professor still wants us to do it for practice. I wrote my program and it worked fine, but after I tried to initialize some of the
I am a bit confused about what the Initialize method is typically used for in a constructor. Why can't I just put everything in the constructor and why does the sample below call the initialize me...