0

what does -= mean c#?

what does -= mean c#?

19th May 2017, 11:35 AM
Corey
Corey - avatar
8 Réponses
+ 4
Found it! It means, for example: a -=b means a = a - b
19th May 2017, 11:39 AM
Corey
Corey - avatar
+ 4
Mmmm cool example~ Good cat :P
20th May 2017, 12:02 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
-_- Yeah yeah yeah....yeah yeah....~ And difference by "faster way"
19th May 2017, 11:40 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 1
a = a-b
5th Jun 2017, 6:29 AM
Romualdus Aldi Hermanto
Romualdus Aldi Hermanto - avatar
0
it mean decrease and equal to a normal minus sigh
19th May 2017, 3:41 PM
Nick Slabysh
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! >^.^<
20th May 2017, 12:00 PM
Elvenkitty
Elvenkitty - avatar
0
Shorthand for num 2 -= num1; // num2= num2-num1; or any other numbers you want to subtract
24th May 2017, 12:15 AM
Tina Gibson
Tina Gibson - avatar
0
a-=b; (known as shorthand operator) a=a-b;
28th May 2017, 4:22 AM
NIKHIL GUPTA