ok i was thinking about making some (simple) code to see whether two rectangles (not actual ones--only the numbers like coords and dimensions exist) are overlapping
i created a "Rect" class and then i got down to passing in the values in each rectangle.
what im wondering is if it is possible to do it without passing in the height,width, and coordinates directly:
instead of something like this:Code:if (isOverlapping(&Rect1,&Rect2))
i tried the first method and in the function:Code:if (isOverlapping(Rect1.getHeight(),Rect1.getWidth(),Rect1.getXCoord(),Rect1.getYCoord());
Code:if (((*r1.getRectYCoord+*r1.getRectHeight)>=(*r2.getRectYCoord))&&((*r1.getRectYCoord+*r1.Height)<=(*r2.getRectYCoord+*r2.getRectHeight))) return true; //trying to use a pointer the the class type
and I get a compiler time error:
im kinda tired right now so i might be doing something entirely stupid...but i dont think so...*yawns*36 main.cpp
request for member `getRectYCoord' in `r1', which is of non-aggregate type `Rect *'