compound-operator Questions
3
Solved
In a lot of languages a = a + b can be written as a += b
In case of numerical operations, a + b is same as b + a, so the single compound operator suffices.
Also, a = a - b can be written as a -=b ...
Pili asked 12/11, 2012 at 17:16
3
Solved
I spotted Java's +=, -=, *=, /= compound assignment operators (good question :)), but it had a part that I don't quite understand. Borrowing from that question:
int i = 5;
long l = 8;
The...
Vermicelli asked 3/1, 2012 at 14:3
1
Question :
char x = 'a';
x += 3; // ok
x = x + 3; // compile time error
Carnegie asked 27/7, 2011 at 13:15
3
Solved
Is:
x -= y;
equivalent to:
x = x - y;
Quotidian asked 10/3, 2010 at 4:31
1
© 2022 - 2024 — McMap. All rights reserved.