0
Ex : ---++x can it be?
example if int x = 0 ---x++ //<-- can it be? then how the answer?
3 ответов
+ 1
#include<iostream>
using namespace std;
int main()
{
int x=0;
---x++;
cout<<x;
}
output :
error
Compiler throws error : left value required as decrement operand
To make it work fine then
you must use parenthesis ()
#include<iostream>
using namespace std;
int main()
{
int x=0;
-(--x)++;
cout<<x;
}
output : 0
if you make x as signed int x then
#include<iostream>
using namespace std;
int main()
{
signed int x=0;
---x++;
cout<<x;
}
output : -1
hope you understood
0
thanks a lot bro
0
welcome buddy !