24.09.2015, 23:07
(
Последний раз редактировалось unSatisfied; 25.09.2015 в 00:19.
)
Why doesn't the following code work? How can I fix this?
Errors:
error 028: invalid subscript (not an array or too many subscripts): "Weapons"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
EDIT: The fix seems to be to replace FactionData[0][Weapons[0]] = 1; with FactionData[0][Weapons][0] = 1; Can anyone explain why it isn't the way I originally coded it?
Код:
#define MAX_FACTIONS 10 enum _FactionData { Weapons[47] }; new FactionData[MAX_FACTIONS][_FactionData]; main() { FactionData[0][Weapons[0]] = 1; }
error 028: invalid subscript (not an array or too many subscripts): "Weapons"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
EDIT: The fix seems to be to replace FactionData[0][Weapons[0]] = 1; with FactionData[0][Weapons][0] = 1; Can anyone explain why it isn't the way I originally coded it?