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 |
in a town the percentage of men is 52 the percentage of total literacy is 48 if total percentage of literate men is 35 of the total population write a program to find the total no of the literate men and women if the population of the town is 80000
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,
how to get the starting address of file stored in harddisk through 'C'program.
who is the founder of c
19 Answers College School Exams Tests, HP,
main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason
What is the use of sizeof () in c?
dynamically allocate memory for linear array of n integers,store some elements in it and find some of them
SRUCTURE PROGRAMMING
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is file in c preprocessor?
write a program to find the frequency of a number
What is pointer to pointer in c with example?