Quote:Original post by King Mir
I guess that's tricky because you have to know that it's undefined.
correct ;) VC will give you 12. borland & gcc 10.
Quote:Original post by King Mir
I guess that's tricky because you have to know that it's undefined.
Quote:Original post by mrbastardQuote:Original post by blaze02
9
I was going to laugh, but I got it wrong as well... I said 6. Will have to read the spec on preincrement and brackets I think.
Quote:Original post by Riekistyx
1. How do you add with out using addition, subtraction, modulus, multiply, divide operators.
2. How do you multiply without multiply operators
3. Whats so bad about iterating through an array of abstract objects?
4. Whats slower casting from float -> int or int -> float or are they the same?
5. Whats negative zero?
6. Whats malloc? Whats new operator? Is there a difference? Why?
lolz enjoy.
// Originalint result = a + b; // Silly answer 1int result = a; result += b;// Silly answer 2int result = a, x = 0;while (x < b) { ++x; ++result; }while (x > b) { --x; --result; }// Useful answerstd::sum<int> op;int result = op(a,b);
Quote:Original post by Riekistyx
1. How do you add with out using addition, subtraction, modulus, multiply, divide operators.
Quote:
2. How do you multiply without multiply operators
Quote:
3. Whats so bad about iterating through an array of abstract objects?
Quote:
4. Whats slower casting from float -> int or int -> float or are they the same?
Quote:
5. Whats negative zero?
Quote:
6. Whats malloc? Whats new operator? Is there a difference? Why?