Well, in languages like C or C++, a variable is just a memory cell. The memory cell can contain any, and then I really mean any, value. For instance, if I were to do something like the following:
int x;
Then I would have no idea what the value of x is, since I did not initialize it. However,
int x = 0;
initializes the variable to be zero.
...are important things in programming. Example: extern int variable; /* declaration */ int variable= 8; /* definition with initialization */
Answer is; initialization *** Edit*** Initialization is correct. Page 59 Programming Logic and Design by Tony Gladdis
When a declared variable receives a value to hold. i.e. int lalalala; lalalala = 0; //initialization of lalalala
Initialization is when you assign a value to a variable at definition. For instance...int i = 123;Assignment is when you assign a value to a variable at a later time. For instance...int i;i = 123;Sometimes, automatic initialization (to zero) can occur without the explicit = clause, such as for file scoped variables, or for variables allocated through a debug allocator, but it is in bad form to depend on such values.I would fire a programmer that repeatedly fails to initialize variables, and I would flunk a student that does the same.
Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10
...are important things in programming. Example: extern int variable; /* declaration */ int variable= 8; /* definition with initialization */
Answer is; initialization *** Edit*** Initialization is correct. Page 59 Programming Logic and Design by Tony Gladdis
Variable initialization is the assignment of an initial value to a variable.
Initialization is nothing but assigning some value to a parameter. ex :- int a; // Defination of an integer variable a = 3; // Initialization of the variable a
In a programming language, a variable is a name for a place where information is stored.
When a declared variable receives a value to hold. i.e. int lalalala; lalalala = 0; //initialization of lalalala
Initialization is when you assign a value to a variable at definition. For instance...int i = 123;Assignment is when you assign a value to a variable at a later time. For instance...int i;i = 123;Sometimes, automatic initialization (to zero) can occur without the explicit = clause, such as for file scoped variables, or for variables allocated through a debug allocator, but it is in bad form to depend on such values.I would fire a programmer that repeatedly fails to initialize variables, and I would flunk a student that does the same.
Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10
Not initialized variable: int myInt; Initialized variable: int myInt = 10;
In computer programming, or in algebra? In computer programming, you can store a value that you recover later, and you can do generic calculations, which work for all sorts of numbers, not just for one specific number.
In computer programming, or in algebra? In computer programming, you can store a value that you recover later, and you can do generic calculations, which work for all sorts of numbers, not just for one specific number.
A variable. In computer programming, you can have a single variable for a group of related numbers - in this case, you speak about an array.