Question: what is the difference between declaration and definition of a variable function?
Answer: Declaration of a variable/function simply declares that the variable/function exists somewhere in the program but the memory is not allocated for them. ... Coming to the definition, when we define a variable/function, apart from the role of declaration, it also allocates memory for that variable/function.