That code is never going to compile.
Try this instead:
1 2 3 4 5 6
Link & newlink()
{
Link temp;
Link &rv = temp;
return rv;
}
Even that I'm not sure is what you want. What are you trying to do anyway? Why don't you have Cell defined? just fiddling around I suppose. I really wouldn't say that Link is equal to Cell*, but rather that Linkis another way for sayingCell*. Cell*& would be an adress of a Cell pointer, I guess.
Hope I could help. (Even though I'm almost positive I didn't.)
#include <cstdlib>
#include "Cell.h"
void main()
{
Link pCell3 = new Cell(3, NULL);
Link pCell2 = new Cell(2, pCell3);
Link pCell1 = new Cell(1, pCell2);
}
can you tell me what it means? i mean, in cell.h about my question...
Link& is a reference to a pointer. It works the same way as a reference to any other type.
If you pass a reference to an int to a function and the function modifies the int, the caller sees the new value. If you pass a reference to a pointer to an int to a function and the function modfies the pointer, the caller sees the new pointer value.