the error is in main where i call PrintChar. it says 'h' is undefined but i thought i defined it with getters and setters. can you tell me where i went wrong? and where to define it? this program is supposed to read in dimensions of rectangles from txt file and print them out in stars
The 'h' and 'w' names are only defined inside the functions 'setHeight' and 'setWidth', but they are not in the rest of your code.
"getters" and "setters" dont define nothing. They are simply functions that return or set values.
From your member function 'PrintChar' you could be using the member variables 'width' and 'height' defined in the 'Rectangle' class.
If you do want to allow a direct specification of a width and height to pass to 'PrintChar', and if you want to use an 'h' and 'w' variables inside main, you'll have to declare them inside main, and then you can set them by using the gets of your rectangle. Or you can use the gets directly in the call to 'PrintChar'.
Also, where is the first 'r' you refer to in main declared?