what is the difference between declaration ,defenetion and
initialization of a variable?

Answer Posted / gg

As i know.....
Definition is one which allocates memory.
Ex: int x;

Declaration never occupy any memory space.
Ex:Function prototype declarations such as....
int func(int,int);

Initialization: If any variable assigned with some value at
time definition itself is called initialization.
Ex:int x=0;

Is This Answer Correct ?    35 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function prototype?

612


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1889


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2715


How do you construct an increment statement or decrement statement in C?

746


Write a c program to demonstrate character and string constants?

1685






What is #line used for?

583


Do pointers store the address of value or the actual value of a variable?

612


what is recursion in C

617


What is the purpose of void pointer?

600


How can I automatically locate a programs configuration files in the same directory as the executable?

633


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

676


What are variables and it what way is it different from constants?

787


What is structure of c program?

608


What are valid operations on pointers?

671


Where define directive used?

608