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

Hi, main() { } Is a user defined function or Built in Functionn

26 Answers   Honeywell, Yahoo,


Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….

1 Answers  


Determine the code below, tell me exactly how many times is the operation sum++ performed ? for ( i = 0; i < 100; i++ ) for ( j = 100; j > 100 - i; j--) sum++;

5 Answers   ITCO, Wipro,


write a program to find lcm and hcf of two numbers??

1 Answers  


what is the difference b/w compiler and debugger?

2 Answers   Assurgent,






Write a pro-gramme to determine whether the number is even or odd?

1 Answers  


How many loops are there in c?

0 Answers  


can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?

2 Answers  


What are the c keywords?

0 Answers  


Write a program to print distinct words in an input along with their count in input in decreasing order of their count

0 Answers  


Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)

12 Answers   Eskom, TCS,


Categories