Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need help writing a function which initializes rect, given the left-top and right-bottom corner locations, which are both within the rectangle.

void Rect_init(Rect* rect, Point left_top, Point right_bottom);

Also writing a function which uses the curses functions move() and addch() to fill the screen area described by rect with the character c

void Rect_fill(const Rect* rect, char c);

What I have tried:

I have tried figuring out the logic but I am having difficulty figure these problems out.
Posted
Updated 14-Mar-16 20:10pm

Left and Right members of Rect correspond to the X member of Point.
Top and Bottom members of Rect correspond to the Y member of Point.
 
Share this answer
 
We need more detail

1.) The definition of the structs Rect and Point to see the fields.
2.) To write to the actual screen we need to know what graphics package you are using

The first one we can sort of guess at but writing to the screen we have no idea what you are using.
 
Share this answer
 
Quote:
I have tried figuring out the logic but I am having difficulty figure these problems out.

This is HomeWork !
HomeWork must be done by you. Think of it as a mean (for your teacher) to detect your weaknesses and it allow to take remedial actions. Simply giving you a working solution is not help on the long run.
I strongly suggest to report your difficulties to your teacher.

If you are stuck o, code you have already written, please post the code and explain your specific problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900