Thursday, September 18, 2008

Difference between declaration and definition in c++

What is the difference between declaration and definition? 

Answer:-


The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration 
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function body
cout << *; cout <<>


What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j>=0; j--) //function body
cout<<”*”; cout<

No comments:

Post a Comment

Thanks to given comments.......

My Blog List