What is difference between initialization and assignment?

Answer Posted / lucky

Some defference between Initialization and assignment
Initialization means whenever we initialize any var. at
declaration time.So as we initialize var. in init() in java
programming.For i.e.
prblic init()
{
int a=10;
}
Assignment means whenever we assigne any value in any var.
except const. variable.For i.e.
int a,b;
a=15; //right
b=a; //right
const c;
c=10 or c=a; //Worng
const d=20; //that is initialization

Is This Answer Correct ?    22 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we change the basic meaning of an operator in c++?

627


Please explain class & object in c++?

576


Can we distribute function templates and class templates in object libraries?

569


Which programming language should I learn first?

556


Difference between struct and class in terms of access modifier.

666






What is c++ 11 and c++ 14?

559


If there are two catch statements, one for base and one for derived, which should come first?

553


What is the oldest programming language?

543


What is microsoft c++ redistributable?

588


What is stream and its types in c++?

532


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

651


What is constructor c++?

645


What is the c++ code?

548


How did c++ start?

587


What are the advantages of c++ over c?

555