| TaytayB (15) | |||
|
This code is designed to Draw a Diamond, I've worked out all the bugs in the main Draw function, which is to be transferred to another project and used to interact with a Class. However I'm currently trying to make sure it works, The project runs and compiles, but doesn't output anything from my Draw(); function. Here is the code:(please note that you'll see "/* << SPACES */, this is intentional and will be replaced after I can figure out the whole output issue, so right now it won't quite look like a diamond when it's outputed)
| |||
|
|
|||
| Disch (8615) | |
|
I didn't look in detail, but right away I notice you are confusing assignment (=) with comparison (==). Lines 45, 47, and 85. Possibly others... those are just the ones I noticed. EDIT: also your indentation is incorrect, leading you to have incorrect assumptions about some statements. For example line 84, even though you [incorrectly] indented it... is not part of that else statement (because the else statement does not have braces), and therefore it will be executed every loop iteration... not just when count > size. Fix up your indentation. Add braces where appropriate. Fix the ='s mistakes. Then see if it's still busted. | |
|
Last edited on
|
|
| TaytayB (15) | |||
Thank you very much! I've been at it for a few hours and knew that there had to of been something simple like that (the ='s) that I kept missing. That aside, I can definitely see an output now, although it's only the first few lines until it get's stuck inside the loop at 66, any more advice would be greatly appreciated!
| |||
|
Last edited on
|
|||
| Disch (8615) | |
fillCount <= fillCount + 2;fillCount will always be less than itself+2 This will loop EDIT: Also, this might be a good opportunity to learn how to debug. I give a general step-by-step in another thread here: http://www.cplusplus.com/forum/beginner/75304/#msg403990 | |
|
Last edited on
|
|
| TaytayB (15) | |
| Again, Thank you!!! A second set of eyes is always a great thing to have! | |
|
|
|