Possible Duplicate:
Incrementing in C++ - When to use x++ or ++x?
What is the difference between x++ and ++x ?
'x' indicates that this value is a single character and can be stored by a variable having the data type as char. Whereas “x” indicates that even though it's a single character but it is going to be stored in the variable having data type as String.
In C and C++, "x" is of type const char[] which is an array and it is null-terminated (0x00). Whilst 'x' is of type char . The datatype std::string . C++ has support in the standard library for the String datatype, which can be assigned a const char[] .
A function is a special kind of relation. In a function, there can only be one x-value for each y-value. There can be duplicate y-values but not duplicate x-values in a function.
x is the value of the x-coordinate. This form is called the slope-intercept form. If m, the slope, is negative the functions value decreases with an increasing x and the opposite if we have a positive slope.
x++
executes the statement and then increments the value.
++x
increments the value and then executes the statement.
var x = 1;
var y = x++; // y = 1, x = 2
var z = ++x; // z = 3, x = 3
x++
returns x, then increments it.
++x
increments x, then returns it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With