0
what does -= mean c#?
what does -= mean c#?
8 Respuestas
+ 4
Found it! It means, for example:
a -=b means a = a - b
+ 4
Mmmm cool example~
Good cat :P
+ 3
-_-
Yeah yeah yeah....yeah yeah....~
And difference by "faster way"
+ 1
a = a-b
0
it mean decrease and equal to a normal minus sigh
0
If you have int x = 10; int y;
y = x-=3;
Console.WriteLine(y);
This will output basically 10 - 3 = 7.
The same thing is if we would have y = x+=3; This will output 10 + 3 = 13.
Just as you said it's basically y = x + 3 or y = x - 3
Hope this helps! >^.^<
0
Shorthand for num 2 -= num1; // num2= num2-num1; or any other numbers you want to subtract
0
a-=b; (known as shorthand operator)
a=a-b;