Error:no match for "operator-" i?

srand ( time(NULL) );
if (u==1)
{
o=rand() % 10;
i=RazvanDMG+o;
bphp=bphp-i;
cout<<endl;
cout<<BO<<" used Shash!"<<endl<<BP<<" takes "<<i<<" damage!"<<endl<<endl;

}
goto Croc;
.............
any ideas?
i declared all variables and it is the first time i get such an error...
What type is bphp and i?
As Peter87 asked, what types are your variables? Also, could you possibly separate your operators for their operands? i.e. bphp=bphp-i; to bphp = bphp - i;. It just makes it easier on the eyes is all.
Last edited on
closed account (3qX21hU5)
And also use code tags please (Hint: they are the <> under format off to the right when replying). But we need more information like your types ect. could you post your whole project or the parts the are related to the error?
I am sorry ,i am beginner in c++ .
So bphp and i are both "unsigned int" variables
And i tried to separate them but i still get that error
@Zereo i can't place the whole project ,it's just huge
closed account (3qX21hU5)
Well really we cant tell you anything from the code you posted what went wrong. There is nothing wrong with the code you posted so (except some minor things but nothing that will give a error that I can see) we need some more.

One minor thing I saw is that your are using goto this is not good except in a select few instances which rarely happen. So I would recommend using a different way to control the flow of your program then goto's because they will cause you more problems then they are worth. Especially if your program is huge like you say then you are going to be in hell when you debug.

Thats all I can help with without more information or more code, but maybe someone else can help you.
Topic archived. No new replies allowed.