What is diffrance between declaration and defination of a variable or function

Answers were Sorted based on User's Feedback



What is diffrance between declaration and defination of a variable or function..

Answer / deepak mundhada

1 when we declare a variable it gets memory allocated at
stack in ram.
definition means we are assigning value to that variable.

2 address of variable can be changed but address cant be
changed.

Is This Answer Correct ?    4 Yes 0 No

What is diffrance between declaration and defination of a variable or function..

Answer / r.ramakrishna

Declaration means allocating memory for the variable.
Definition means defining address of the variable in a class.

Is This Answer Correct ?    3 Yes 1 No

What is diffrance between declaration and defination of a variable or function..

Answer / nagarjuna reddy

once a variable is defined it'l never change through entire
program.
but declaration of a variable can be changed as per our
requirement.

Is This Answer Correct ?    3 Yes 1 No

What is diffrance between declaration and defination of a variable or function..

Answer / manish soni bca 3rd year jaipu

IN FUNCTION;
-------------------------------------------
1:)DECLARE: int sum(int);//close with semicolon;

2:)DEFINATION: int sum(int n)//not colse with semicolon;
{
//logic of the function;
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Please write me a program to print the first 50 prime numbers (NOT between the range 1 -50)

5 Answers   IBM, KJH,


Who had beaten up hooligan "CHAKULI" in his early college days?

1 Answers  


If the size of int data type is two bytes, what is the range of signed int data type?

0 Answers  


What is the purpose of macro in C language?

0 Answers   Fidelity,


How to explain the final year project as a fresher please answer with sample project

0 Answers  






can we declare a variable in different scopes with different data types? answer in detail

3 Answers   TCS,


Why malloc is faster than calloc?

0 Answers  


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

0 Answers  


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

0 Answers  


why do some people write if(0 == x) instead of if(x == 0)?

0 Answers  


what is d pitfalls of registers variables

3 Answers   TCS,


What is a #include preprocessor?

0 Answers  


Categories