T
The Directive
This code will not compiled:
In main function:
Dot temp = new Dot( *(new Point( 5, 5 )) );
In Dot class:
//Constructor with default arguments.
Dot:ot( Point& point= *(new Point( 5, 5 )),
Color& color = *(new Color( 100, 125, 106 )) )
{
}
It complains that:
Main.cpp
[Warning] In function `int main(int, char**)':
Main.cpp
no matching function for call to `Dot:ot(Point&)'
Dot.h
candidates are: Dot:ot(Dot&)
Dot.h
Dot:ot(Point&, Color&)
Main.o(.text+0x84)
[Warning] In function `main':
[Linker error] undefined reference to `Dot:ot()'
I'm using DEV-C++ and gcc.
Why doesn't it find the matching constructor:
Dot:ot(Point&, Color&)
--The Directive
In main function:
Dot temp = new Dot( *(new Point( 5, 5 )) );
In Dot class:
//Constructor with default arguments.
Dot:ot( Point& point= *(new Point( 5, 5 )),
Color& color = *(new Color( 100, 125, 106 )) )
{
}
It complains that:
Main.cpp
[Warning] In function `int main(int, char**)':
Main.cpp
no matching function for call to `Dot:ot(Point&)'
Dot.h
candidates are: Dot:ot(Dot&)
Dot.h
Dot:ot(Point&, Color&)
Main.o(.text+0x84)
[Warning] In function `main':
[Linker error] undefined reference to `Dot:ot()'
I'm using DEV-C++ and gcc.
Why doesn't it find the matching constructor:
Dot:ot(Point&, Color&)
--The Directive