Thread: compiling error
View Single Post
Old Oct 27th, 2006, 2:33 AM   #15
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 852
Rep Power: 4 The Dark is on a distinguished road
See my edit to my previous post.

You might find it better all round to use the Screen's public setPoint function, rather than mucking about making things friends. Then you just make Rectangle::draw something like:
     void Rectangle::draw( Screen&  object)//prints contents of rectangle on screen object
     {
          
          int x1=upLeft.getX();
          int y1=upLeft.getY();
          for(int i=x1;i<(x1+width);i++)
             for(int j=y1;j<(y1+height);j++)
             {
                 Point point(x1,y1);
                 object.setPoint(point, 'x');
             }                
      }
If you are doing this for a class, then I would imagine that is what they would want you to do.
The Dark is offline   Reply With Quote