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

Explain differences between alloc() and free()?

580


Tell me can a pure virtual function have an implementation?

558


What are proxy objects in c++?

643


What is general format for a prototype?

599


Can a program run without main?

631






What does the nocreate and noreplace flag ensure when they are used for opening a file?

681


What is the difference between c++ and turbo c++?

590


How long it will take to learn c++?

618


what is upcasting in C++?

722


Define a pointer to a data member of the type pointer to pointer?

574


What will the line of code below print out and why?

330


What is ios :: in in c++?

637


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

571


What is c++ & why it is used?

592


What is #include iostream h in c++?

616