|
| Tanthialas (3) | |||
I'm trying to create a Word Jumble program where the user can choose a difficulty. My code is as follows:
I don't know what's causing it to not work. I've even asked a pal, but he can't figure out what I'm doing wrong either (though on his end he's getting syntax errors on the if and while portions). Here's the uploaded .cpp file if it could help somebody figure out my issues: http://www.megaupload.com/?d=I9SZ4WVY (sorry if I'm not supposed to link or code links like this, I'm used to another forum so it's a habit now).Any help would be appreciated. | |||
Last edited on | |||
| bluezor (233) | |
I don't know if this will fix, but - if (difficulty = EASY)
if (difficulty = NORMAL)
if (difficulty = HARD)Equality . Symbol . | |
| Tanthialas (3) | |
| Gah, I don't know how I missed that. Fixing that didn't do anything though, I'm still getting the same number of errors. Here's what they are: Line 30: Expected primary expression before "if" Line 30: Expected ';' before "if" Line 50: Expected primary expression before "==" token Line 50: Expected primary expression before "==" token Line 60: Invalid types 'main()::fields[int]' for array subscript Line 60: Invalid types 'main()::fields[int]' for array subscript Thanks for pointing that out though bluezor. | |
Last edited on | |
| R0mai (371) | |
| You are missing a semi-colon on line 27. difficulty is not a variable, but a (enum) type, make a variable with type difficulty. | |
| Tanthialas (3) | |
| I was told on another forum that I really screwed up the content of the if statements, so I think I'll put this on hold until I've learned more. Thanks for all the help though :) | |
This topic is archived - New replies not allowed.
