All Questions

671
votes
13answers
54348 views

Why are these constructs (using ++) undefined behavior in C?

#include <stdio.h> int main(void) { int i = 0; i = i++ + ++i; printf("%d\n", i); // 3 i = 1; i = (i++); printf("%d\n", i); // 2 Should be 1, no ? volatile int u = 0; u...
8
votes
1answers
1241 views

Variables in batch not behaving as expected

I've been wrestling trying to get the syntax right on this batch file and I can't for the LIFE of me figure out why some things aren't working. 1) The variable 'i' is not getting incremented. and 2) ...
84
votes
16answers
131704 views

Is there a difference between x++ and ++x in java?

Is there a difference between ++x and x++ in java?
83
votes
6answers
23142 views

++someVariable Vs. someVariable++ in Javascript

In Javascript you can use ++ operator before or after the variable name. What, if any, are the differences between these ways of incrementing a variable?
515
votes
6answers
567549 views

Behaviour of increment and decrement operators in Python

I notice that a pre-increment/decrement operator can be applied on a variable (like ++count). It compiles, but it does not actually change the value of the variable! What is the behavior of the pre-i...
469
votes
27answers
20911 views

Why does this go into an infinite loop?

I have the following code: public class Tests { public static void main(String[] args) throws Exception { int x = 0; while(x<3) { x = x++; System.out.pr...
101
votes
10answers
29077 views

Pointer expressions: *ptr++, *++ptr and ++*ptr

Recently I have come across this problem which I am unable to understand by myself. What do these three Expressions REALLY mean? *ptr++ *++ptr ++*ptr I have tried Ritchie. But unfortunately was un...
34
votes
11answers
8043 views

Why is ++i considered an l-value, but i++ is not?

Why is ++i is l-value and i++ not?
112
votes
5answers
132740 views

Increment a database field by 1

With MySQL, if I have a field, of say logins, how would I go about updating that field by 1 within a sql command? I'm trying to create an INSERT query, that creates firstName, lastName and logins. H...
99
votes
9answers
41598 views

The "++" and "--" operators have been deprecated Xcode 7.3

I am looking at Xcode 7.3 notes and I notice this issue. The ++ and -- operators have been deprecated Could some one explain why it is deprecated? And am I right that in new version of Xcode now...

Previous Next