0 votes
88 views
in Discuss by (98.9k points)
edited
What are the differences between a declaration and a definition?

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
There are two differences between a declaration and a definition: In the definition of a variable space is reserved for the variable and some initial value is given to it, whereas a declaration only identifies the type of the variable. Thus definition is the place where the variable is created or assigned storage, whereas declaration refers to places where the nature of the variable is stated but no storage is allocated. Secondly, redefinition is an error, whereas, redeclaration is not an error.

Related questions

0 votes
1 answer 121 views
asked Aug 27, 2022 in Discuss by Doubtly (98.9k points)
0 votes
1 answer 148 views
asked Aug 9, 2022 in Discuss by Doubtly (98.9k points)
0 votes
1 answer 137 views
asked Oct 1, 2022 in Tailwind by Doubtly (98.9k points)
0 votes
1 answer 113 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...