View Single Post
  #2 (permalink)  
Old 01-19-2008, 02:09 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: Declaration and definition in C++.

Difference between declaration and Definition

Declaration
It just indicate the presence of a variable or memberfunction and ends with a semi-colon.

For eg;
int i;-->declaration
add();--->declaration

Definition
It explains the behaviour of the function.If it is a variable it defines its value.

For eg:
int i=2;--->It is definition of a variable
add()--------->Definition
{
int a=2,b=3,c;
c=a+b;
}
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote