pointer to variables in Doc.h is there a way of doing it?
I have defined a function in my Doc.h file that uses several variables also defined in this file, one of which is the definition of
I have another function that belongs to a Class that needs to access one of these outside functions. I have declared a pointer of type CDoc to enable me to get at this outside function. Below is the code for the class function ncrosses
struct vector r1;
struct vector r2;};
int CLine::ncrosses(int m_XYCoOrds)
ASSERT_VALID(pDoc);//get pointer to Doc
int NumLines = 0;
int x1 = 0;
int y1 = 0;
int x2 = 0;
int y2 = 0;
x1 = m_XYCoOrds[t];
y1 = m_XYCoOrds[t];
x2 = m_XYCoOrds[t+1];
y2 = m_XYCoOrds[t+1];
struct LineSeg *l1;
/*printf("hit %d ",i); */ /* only need to know about one line
crossed to know zone crossed or partially
crossed, could modify to get more info.*/
However when I try and compile the program it throws up an error saying
I think the problem is that the line in red is declaring a variable in CLine object, which then can't be passed to the function coords2lineSeg(x1,y1,x2,y2); in CLinesDoc. Is this right, is it making any sense so far? I don't know what to do, I am a begining windows programmer and don't know if everything is in the right place. Any help at all would be much appreciated, even if its just to tell me where to put everything properly.
Line.cpp(140) : error C2440: '=' : cannot convert from 'struct CLinesDoc::lineSeg *' to 'struct CLine::ncrosses::lineSeg *'