Notice how when you indent the contents of the function, you use two spaces? You do that consistently, which is good, but...
When you get to something like the for loop, you indent 3 spaces.
Tubs
Posted: Thu Nov 17, 2005 8:21 pm Post subject: (No subject)
Ah ok. So now that the indenting issue is out of the way, any ideas on where the logic error(s) is?
wtd
Posted: Thu Nov 17, 2005 8:31 pm Post subject: (No subject)
Well, one error at a time.
Line 61:
c:
scanf ("% c", letter);
The space between "%" and "c" will cause a problem, as will the fact that you are using "letter", which passes the value of the variable, rather than "&letter", which passes a pointer to that variable.
Tubs
Posted: Thu Nov 17, 2005 8:35 pm Post subject: (No subject)
I was told to do that to bypass some logic error that occurs when the return key is hit before the scanf, and the value for return is used in place of the letter.
Tubs
Posted: Thu Nov 17, 2005 8:41 pm Post subject: (No subject)
In fact, it happens right here. After you enter the amount of guesses you want, it records the return as the letter you want to guess.
Tubs
Posted: Thu Nov 17, 2005 8:43 pm Post subject: (No subject)
I put the space in the wrong spot.
Sponsor Sponsor
Tubs
Posted: Thu Nov 17, 2005 9:51 pm Post subject: (No subject)
Ok, I think I caught all of them. I will post the program once its done
Tubs
Posted: Thu Nov 17, 2005 10:06 pm Post subject: (No subject)
Ok, here is #1 done. Game of life next ... Thank you so much for your help wtd
Posted: Thu Nov 17, 2005 10:08 pm Post subject: (No subject)
It would help if you didn't make 5 consecutive posts . You should know well enough there is an edit button, and that posts like "I will post the program once its done" are not neccessary.
[Gandalf]
Posted: Thu Nov 17, 2005 10:10 pm Post subject: (No subject)
Well, silly me, there is no edit button! Still, limit your posts to important things.
I don't like this idea of no 'edit' button in help forums, it really causes more trouble than it solves (afaik).
md
Posted: Thu Nov 17, 2005 10:18 pm Post subject: (No subject)
Why is there no edit button?! Tony... I blame tony...
wtd
Posted: Thu Nov 17, 2005 10:37 pm Post subject: (No subject)
Hopefully you realize that an executable tells me precisely squat.
Tubs
Posted: Thu Nov 17, 2005 10:39 pm Post subject: (No subject)
wtd wrote:
Hopefully you realize that an executable tells me precisely squat.