![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2006
Posts: 120
Rep Power: 3
![]() |
compiling error
Hi,
I have a compiling error but I do not understand why: I have 2 class Rectangle and Screen. I have to code a function in class rectangle whose the prototype is: void Rectangle::draw( Screen object) Since the class Screen is the argument of the function, I set friend class Screen in the public section of the class Rectangle. void Rectangle::draw( 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++)
object.pixels[x1][y1];//error 1 and 31-`object' has incomplete type 2-forward declaration of `struct Screen' // refer to line where I declared friend class Screen 3-invalid use of undefined type `struct Screen' Please, can someone please tell me the problem? B. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |