warning

what is the meaning of this warning?
Ambiguous operators need parentheses in function main ().
it helps if you show us the code that's causing that warning.
so why this warning is comming
I don't know. I can't see the code that's causing it.

I can only guess that you're getting the warning because you are using ambiguous operators, and to correct it you would have to use parenthesis. The problem is likely in the main() function.
Last edited on
i hv get wht u r saying but if there is:
cout<<x+x;
here we have to use parenthesis but why explain me
The compiler is telling you that you probably should do this:

cout << (x+x); to make your intentions more clear.

However, + has a higher precedent than <<, so it isn't actually necessary. Your compiler is just being overly cautious. Maybe you can try reducing the warning level in your compiler settings... or just put parenthesis around it.

I would do the latter -- I prefer putting parenthesis wherever there is possibility for confusion. Not everyone has the order of precedence memorized, so I like to clarify it whenever possible.
Topic archived. No new replies allowed.