0

Why are the output of this codes different

C++ #include <iostream> using namespace std; int main() { int a =0; cout << ++a + (++a*a++); return 0; } AND JavaScript var a = 0; alert(++a + (++a*a++));

28th Dec 2017, 7:23 AM
Ifeanyichukwu Otiwa
Ifeanyichukwu Otiwa - avatar
4 Answers
+ 12
As Mr.JPM7 said in a nutshell, try to avoid using these kinds of BAD practices in your learning curve (Since there are so many gotchas in C++ that can give you hard time). but being curious is another thing. If you want to try every single pitfall by yourself deeply, without listing to the mentors' advices then go for it, my brother!
28th Dec 2017, 1:55 PM
Babak
Babak - avatar
+ 1
That's a cool reply. but I still don't understand the Arguments from the link
28th Dec 2017, 7:42 AM
Ifeanyichukwu Otiwa
Ifeanyichukwu Otiwa - avatar