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

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);

5 Answers  


hi any body pls give me company name interview conduct "c" language only

0 Answers  


Write a c program using for loop in switch case?

1 Answers   Infosys,


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

0 Answers  


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

0 Answers  


What are the types of arrays in c?

0 Answers  


what is the little endian and big endian?

1 Answers  


Why is c called a structured programming language?

0 Answers  


Why shouldn’t I start variable names with underscores?

0 Answers  


What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


What is the difference between #include and #include 'file' ?

0 Answers  


DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?

2 Answers   Wipro,


Categories