what's the difference between the following two snippets of code? In a. B is returned; in b. B& is returned.
a.
class B
{
public: int i;
};
class D
{
public:
B fd(){B db; db.i=2; return db;}
};
b.
class B
{
public: int i;
};
class D
{
public:
B& fd(){B db; db.i=2; return db;}
};