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

Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 01 012 0123 01234 plz answer it 2day

3 Answers  


Why do we use static in c?

0 Answers  


What is cohesion and coupling in c?

0 Answers  


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

0 Answers  


what is different between auto and local static? why should we use local static?

0 Answers  






explain what is a newline escape sequence?

0 Answers  


Explain why can’t constant values be used to define an array’s initial size?

0 Answers  


what is bit rate & baud rate? plz give wave forms

0 Answers  


What is the diffrent between while and do while statement ?

6 Answers  


What is difference between function overloading and operator overloading?

0 Answers  


write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.

6 Answers  


what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }

4 Answers  


Categories