Your problem is actually the first four lines of the main() function. I've added comments to the code that are related to problems on each line.
void main() // main should return int, not void
{
sLink* pChainLink; // uninitialised pointer
sLink ChainLinkNo1 (pChainLink, 1); // undefined behaviour: accessing value of uninitialised pointer
sLink ChainLinkNo2 (ChainLinkNo1, 2); // compiler error: ChainLinkNo1 not a pointer, sLink's constructor expects one
sLink ChainLinkNo3 (ChainLinkNo2, 3); // compiler error: ChainLinkNo2 not a pointer, sLink's constructor expects one
The only reason the compiler is complaining about the line you have highlighted is that it is the only constructor that might be invoked by your code, but you've provided the wrong type of argument.
Last edited by grumpier; Dec 4th, 2008 at 11:36 pm.