This is my class...
Code:
class ivar
{
public:
float real, immaginary;
ivar(){}; // Constructor
// ~ivar(){};
ivar(float, float);
ivar operator + (ivar);
ivar operator - (ivar);
ivar operator * (ivar);
ivar iscreen(float maxx, float minx, float maxi, float mini, int screenx, int screeny, int x, int y);
ivar iantiscreen(float maxx, float minx, float maxy, float miny, int screenx, int screeny, int sx, int sy);
}z, c;
and this is the iscreen function:
Code:
ivar ivar::iscreen(float maxx, float minx, float maxi, float mini, int screenx, int screeny, int x, int y)
{
ivar answer;
answer.real=((maxx-minx)/screenx)*x+minx;
answer.immaginary=((maxi-mini)/screeny)*y+mini;
return(answer);
}
and when I try to use this function later on in the program with this:
Code:
c=ivar.iscreen(maxX, minX, maxY, minY, ScreenX, ScreenY, x, y);
the compiler gives me the error:
expected primary-expression before '.' token
------------------------------
I don't know what I'm doing wrong, this is the first time I've used classes, and following the tutorials precisely leads me to this implementation, however it doesn't seem to work!
Any Class enlightenment would be of great service. Thanks!