Following is the code snippet:
Code:
#include <stdio.h>
typedef double D;
class Action_Figure
{ D x;
public:
Action_Figure( D a, D b ) { x = a * b; }
Action_Figure( D a ) { x = a; }
Action_Figure() { x = 5.0;
void operator()() { printf("Action Level at %g\n", x); }
};
int main()
{
Action_Figure plane_man( 2.2, 8.6 );
Action_Figure train_man();
Action_Figure truck_man( 3.3 );
plane_man();
train_man();
truck_man();
return 0;
}
operator and Action_Figure() constructor
When I execute this i get the following error
( text+0x57): undefined reference to `train_man
How do i resolve this when I need both the features..
One workaround wat i thought was
Code:
class Action_Figure
{ D x;
public:
Action_Figure( D a, D b ) { x = a * b; }
Action_Figure( D a ) { x = a; }
Action_Figure() { x = 5.0;
void operator()()
{ printf("Action Level at %g\n", x); }
}train_man;
