Initialization (programming): Difference between revisions

Content deleted Content added
Ok
Tags: Mobile edit Mobile web edit
m Reverting possible vandalism by 2405:205:1080:DE97:0:0:78E:80AD to version by Tea2min. Report False Positive? Thanks, ClueBot NG. (3130232) (Bot)
Line 1:
ntIn [[computer programming]], '''initialization''' is the assignment of an initial value for a [[data object]] or vationvariable. The manner in which initialization is performed depends on [[programming language]], as well as type, storage class, etc., of an object to be initialized. Programming constructs which perform inisinitialization are typically called '''initializers''' and '''initializer lists'''. Initialization is distinct from (and preceded by) [[declaration (computer programming)|declaration]], although the two can sometimes be conflated in practice. The complement of initialization is [[finalization]], which is primarily used for objects, but not variables.
 
Initialization is done either by statically embedding the value at compile time, or else by assignment at [[Run time (program lifecycle phase)|run time]]. A section of code that performs such initialization is generally known as "initialization code" and may include other, one-time-only, functions such as opening files; in [[object-oriented programming]], initializationonstructorinitialization code may be part of a ''[[Constructor (object-oriented programming)|constructor]]'' (class method) or an ''initializer'' (instance method). Setting a memory ___location to [[hexadecimal]] zeroes is also sometimes known as "clearing" and is often performed by an [[exclusive or]] instruction (both operands specifying the same variable), at [[machine code]] level, since it requires no additional memory access.
 
==C family of languages==