I get:for:Code:Warning W8066 d.cpp 11: Unreachable code in function main() Warning W8004 d.cpp 10: 'exp' is assigned a value that is never used in function main() Error E2335 d.cpp 15: Overloaded 'exp' ambiguous in this context in function levup() Error E2335 d.cpp 16: Overloaded 'exp' ambiguous in this context in function levup()
Could someone tell me what I'm doing wrong?Code:#include <iostream.h> #include <conio.h> #include <stdlib.h> #include <string> void levup(); int level=1; int main() { int exp=99; for(;;){ exp++;cout<<"Your level is: "<<level; levup();} getch(); return 0; } void levup(){ if (exp==100){ exp=0; level++; } return; }
P.S.:This is a part of my new RPG.



LinkBack URL
About LinkBacks


