Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between declaration and definition?

Answers were Sorted based on User's Feedback



What is the difference between declaration and definition?..

Answer / adarsh gupta

Function declaration -
*Requires semicolon,
*Contains actual parameters,
*Tells about the type of value returned by function,
*This unit can't be invoked from other parts of program.

Function definition-
*Don't require semi coloun,
*Contans the main part(main ligic) of the program,
*Can be invoked from other parts of program,
*Uses formal parameters.

Is This Answer Correct ?    1 Yes 0 No

What is the difference between declaration and definition?..

Answer / alok

defination=(declration+space reservation)
int a; -------------Declaration
a=20; ------------- Defination

For Function

int alok(int a,int b); ---------------Declaration
int a=alok(5,10) ---------------Function call
int alok(int a,int b) Function Defination Logic is here
{
int c=a+b;
return(c);
}
// Alok contact number 9993032168,9650549204

Is This Answer Correct ?    0 Yes 0 No

What is the difference between declaration and definition?..

Answer / soumyajit

During declaration we just specify the type and no memory
is allocated to the variable. But during the definition an
initial value is assigned and memory is allocated to the
variable.

or we can also say,

Declaration means just telling to complier about variable
or function but definition means actually allocating memory
for variable.

Is This Answer Correct ?    1 Yes 1 No

What is the difference between declaration and definition?..

Answer / durga devi.s

variable must be declared and defined before used in the program
variable declaration:
1. tells the compiler what is the name of the variable.
2. specifies what type of data values the variable can hold.

variable definition
1. reserves the memory for the declared variable and store
some value is called garbage value.
-> variable declaration and variable definition done at the
same time.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between declaration and definition?..

Answer / arun

if declaration is only informing compiler that the return
data type then the following should not work

int a;
int b;
b=a;

The above code will work even if a has no memory assigned

Is This Answer Correct ?    1 Yes 3 No

What is the difference between declaration and definition?..

Answer / palsaniya sadikhasan, meta.

Declaration of variable and function means to create memory
for a variable or function.
e.g. int a;
will create a memory 2 byte in main memory.

definition means to assign a value to the particular
variable that are used in function.

Is This Answer Correct ?    4 Yes 6 No

What is the difference between declaration and definition?..

Answer / abdi

I thing it is acorrect

Is This Answer Correct ?    1 Yes 5 No

What is the difference between declaration and definition?..

Answer / deepanjali joshi

Declaration means,we just inform to compiler return
type,funtion name and argument list of funtion that later
use in program.Definition define the operation of that
funtion.

Is This Answer Correct ?    15 Yes 20 No

What is the difference between declaration and definition?..

Answer / amiya

defination=(declration+space reservation)
int a; -------------Declaration
a=20; ------------- Defination

For Function

int amiya(int a,int b); ---------------Declaration
int a=amiya(5,10) ---------------Function call
int amiya(int a,int b) Function Defination Logic is here
{
int c=a+b;
return(c);
}

Is This Answer Correct ?    24 Yes 33 No

What is the difference between declaration and definition?..

Answer / sandhya shetty

Declaration means only declaring a function or a variable
with its return type or datatype respectively.

Definition means assiging values to variable or procedure
to be performed by a function.

Is This Answer Correct ?    21 Yes 41 No

Post New Answer

More OOPS Interview Questions

I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.

0 Answers  


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

0 Answers  


what is ltti

1 Answers   Unisys,


Give two or more real cenario of virtual function and vertual object

0 Answers   TCS,


What are the three main types of variables?

0 Answers  


What are the different forms of polymorphism??

8 Answers   Mantaq, NUC, PCS,


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

0 Answers  


what are the uses of C++

1 Answers  


what is the basic concept of inheritance?

9 Answers  


should we use linear search or binary search if elements are placed in random order or mixed?in both cases? i need a little bit detail ans?thnks

2 Answers  


Why do we use class?

0 Answers  


What is a class oop?

0 Answers  


Categories