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 |
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
Differentiate call by value and call by reference?
What does the && operator do in a program code?
What are the types of c language?
What is volatile c?
Which is an example of a structural homology?
Is c still relevant?
Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!
What does calloc stand for?
What is variable initialization and why is it important?
What is the purpose of Scanf Print, getchar, putchar, function?
When is a null pointer used?