I have some doubts concerning some basic C++ concepts, and would be very thankful, if someone would kindly clear the doubts:
a) Every variable of a data type occupies a specific amount of memory, like int occupies 2 bytes and so on. So, if I declare a reference variable as,
int &y = int x;
How much memory does the reference variable occupy?
b) Suppose I have a structure named "person", like:
struct person
{
//Data members...
}
and I also have a class named "person", in the same program, like:
class person
{
//Class members
}
and then if I declare person p
, will a "person" type variable be created, or will an object of the "person" class be created?
Again thanks in advance.