Definition of a variable problem?

Ok, so right at the beginning of my code, I initialize three global variables, level, exp, and gold. My exp variable, however, doesnt seem to want to work, and I get this error:

1>c:\users\lisa\desktop\c++ projects ;d\pointerdot\pointerdot\pointerdot.cpp(9): error C2365: 'exp' : redefinition; previous definition was 'function'

What is this, and why does it say something about 'function' (whatever that is)?
Check line 9 in your code. It seems like you have declared 'exp' twice, or maybe a function with the same name.
Last edited on
Probable your compiler considers also the function declared in c++:
http://www.cplusplus.com/reference/clibrary/cmath/exp/

I would suggest to use a different name for your variable (maybe Exp?)

Maybe you also don't want to use global variables also but that's a different problem...
Oh thanks, I didnt know that was a function xD It was also saying something about ambiguity, so I'm guessing that was it :P
Topic archived. No new replies allowed.