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

Answer Posted / harshit

there is no practical such as declaration its in theory only
the only practical application is :

int a; //defination
a=10; //intialization

this is a normal thing we do,,,now

somemethod()
{
int a;//defination
}


main()
{
extern int a;//declaration
a=10//intialization
}

here we declare that there is a variable "a" somewhere
n this is the only use of declaration ...
to best of my knowledge...
plz suggest if someone kno better

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default value of local and global variables in c?

551


What is indirection?

637


What is a spanning Tree?

935


How can I get random integers in a certain range?

604


Explain the ternary tree?

590






How many types of arrays are there in c?

585


What does void main return?

597


Suggesting that there can be 62 seconds in a minute?

588


What are different types of pointers?

552


What is malloc calloc and realloc in c?

649


What are qualifiers and modifiers c?

535


What is malloc return c?

588


What are the back slash character constants or escape sequence charactersavailable in c?

676


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2639


What is %d called in c?

748