Not initialized variable:
int myInt;
Initialized variable:
int myInt = 10;
Is an important thing to do.
The general order of initialization is:Base class objects (if present)Member data objectsConstructor function code
Initialization. Hint: your compiler might warn you, neverignore warnings if you aren't absolutely sure what they mean.
Initialization of objects means to provide an initial value for the object. This is usually done by the constructor, or it can be done with an assignment statement.
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
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
It is used to distinguish between the C or C++
Definition. Example: extern int x1; /* declaration */ int x2; /* definition */ int x3= 2; /* definition with initialization */
I guess you mean Java, there is no interface in C++.
for is a loop in C++. It is used to repeat some instructions for required time. Syntax : for(counter initialization;condition;counter update) e.g. //Program to print numbers from 1-100 #include<iostream.h> #include<conio.h> void main() { int i; for(i=1;i<=100;i++) cout<<i<<endl; getch(); }
c is any constant value
b=2 a=1 c=3 so b plus a =c