+ 1
What's the difference between definition and declaration in C++?
And can I call parameter a variable?? What's the difference between reference and variable?
9 Answers
+ 3
Declaration of a variable is for informing to the compiler the following information: name of the variable, type of value it holds and the initial value if any it takes. i.e., declaration gives details about the properties of a variable.
Whereas, Definition of a variable says where the variable gets stored.
no, you can't call a parameter as variable.
Variables are kinda label for the memory that stores the actual data. Pointers stored the address of the variables.
References are alias for the variables.
+ 1
...the title and description aren't matching. do you wanna ask about all four or any two?
+ 1
Coding Kitty Does function hold space in memory too?
+ 1
they do. even if you don't call them in the main function. but you shouldn't be concerned about that for now.
0
Coding Kitty I am sorry for this
All four..
0
Mirielle
Ok,
variable declaration and defination - â
But are you calling parameter a variable??
Coding Kitty said, parameters and variables aren't same...:/
I don't get it..
0
Mirielle
https://code.sololearn.com/cq1S7wD2B9vx/?ref=app
Here parameter has an adress too.. đ€
Whatever, I ran the program 10-12 times and it's changes memory location.. Can you please search for where did I go wrong??