What is diffrance between declaration and defination of a variable or function
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
which of 'arrays' or 'pointers' are faster?
How can I change the size of the dynamically allocated array?
What is signed and unsigned?
what is the use of ‘auto’ keyword?
c pgm count no of lines , blanks, tabs in a para(File concept)
Do string constants represent numerical values?
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Do pointers store the address of value or the actual value of a variable?
explain how do you use macro?
Explain what is the difference between a string and an array?
how the size of an integer is decided? - is it based on processor or compiler or OS?
19 Answers HCL, JPR, Microsoft, nvidia,