-
Couldn't load subscription status.
- Fork 353
Open
Description
Link:
https://github.com/devtut/generate/blob/master/docs/cpp/references.md
I quote:
void func (int &fParam ) {
cout<<"Address inside function => "<<fParam<<endl;
}
int main() {
int i = 10;
cout<<"Address inside Main => "<<&i<<endl;
func(i);
return 0;
}
In this example also, both cout will print the same address.
Output:
Address inside Main => 0x14561ffb1c
Address inside function => 10
In this case, the function func outputs the value of the variable, not its address. Checked by the compiler.
Metadata
Metadata
Assignees
Labels
No labels