S
subramanian100in
I read in textbooks and in this Usenet group that
a reference is not an object but only an alias.
consider
#include <iostream>
using namespace std;
int main()
{
int obj = 100;
int &ref = obj;
cout << ref << endl;
return 0;
}
When this program is run, will there be a memory location created
for the variable ref ? Or the compiler will replace ref with obj ?
I do not know how to check whether a variable occupies some
memory(that is, stored in memory) when a program is run.
Kindly explain
Thanks
V.Subramanian
a reference is not an object but only an alias.
consider
#include <iostream>
using namespace std;
int main()
{
int obj = 100;
int &ref = obj;
cout << ref << endl;
return 0;
}
When this program is run, will there be a memory location created
for the variable ref ? Or the compiler will replace ref with obj ?
I do not know how to check whether a variable occupies some
memory(that is, stored in memory) when a program is run.
Kindly explain
Thanks
V.Subramanian