Linked Questions

0 votes
10 answers
26k views

Possible Duplicate: Post Increment and Pre Increment concept? I cant understand how the "if condition" works with the increment/decrement operator in this scenario: #include<stdio.h> void ...
Anvay's user avatar
  • 345
0 votes
2 answers
14k views

Possible Duplicate: Post Increment and Pre Increment concept? Can any one explicitly explain how prefix increment differs from suffix increment? also can someone explain why this output 6? i=1; ...
user1741485's user avatar
0 votes
6 answers
10k views

I can not grasp the concept as to how these statements produce different values. As far as I know x+=1, means x = x + 1. I also know that x++ should be equivalent to x + 1. I've also searched this ...
bob's user avatar
  • 33
0 votes
4 answers
3k views

I'm trying to learn java oop and i find some problem understanding why the use of post-increment in Recursive Method cause error ? I don't understand . Main Class : public class Main { ...
stackoverflow User's user avatar
-1 votes
7 answers
179 views

I have a C function: static uint8_t func( uint8_t a ) { return ( (a++) % 4 ); } When I call it: uint8_t b = 0; b = func(b); I found b still is 0 not 1. Why?
Aaron Wang's user avatar
-1 votes
4 answers
1k views

What is the difference between ++x and x++? I know ++x increments then return the value. and x++ assign the value then adds. But I'm still not sure how it works and when to use either one. Please ...
MyName's user avatar
  • 31
0 votes
3 answers
192 views

I don't understand why a equals 1 and b equals 0 at the end. They should be the same in my view. Thanks in advance. #include "stdio.h" int main() { int a=0; int b=0; a++; printf("a=%...
Jaden's user avatar
  • 141
0 votes
3 answers
169 views

so I am looking at the following snippet of code int a = 3; int b = 2; b = a++; cout << ++b; My understanding line by line is: initiate a = 3 initiate b = 2; assign the value of (a+1) to b, so ...
Hbi Giu's user avatar
  • 113
0 votes
3 answers
503 views

int main(){ int a[5]= {5, 1, 15, 20, 25}; int i, j, k=1, m; i = ++a[1]; // i becomes a[1] + 1 which is 2 but a[1] changes to 2 even though I'm assigning a value to i? j = a[1]++; // j ...
Alex Oh's user avatar
  • 91
0 votes
1 answer
306 views

just today I stumbled across this short piece of code that confused me a little. #include <iostream> #include <iterator> int main() { int array[] = {0,1,2,3,4,5,6,7,8,9}; auto start = ...
Philipp317's user avatar
0 votes
2 answers
128 views

I have following C program and I'm not understanding the output of this program: #include <stdio.h> int main() { int a=8; printf("%d\n", a++); printf("%d\n", ++a); printf("%...
opu 웃's user avatar
  • 462
-3 votes
3 answers
241 views

Please can someone clearly explain to me in a very detailed layman understanding manner. The actually difference between --i and i-- And where exactly should which be used over which. Example or ...
Basil Bassey BSc. Ms.'s user avatar
-3 votes
2 answers
90 views

I can't seem to understand this operation. What is the output of the following code? I've tried interpreting why b has two different values one as b=1+2 and the other as b=2, since a++ should equal ...
user665997's user avatar
0 votes
1 answer
62 views

I wrote this code to change label text. but id does not change: void DateTimes::on_btnHourP_clicked() { int h=ui->txtHour->text().toInt(); if(h==24) h=-1; ui->txtHour-...
H.Ghassami's user avatar
  • 1,022
0 votes
1 answer
64 views

Here is the code: int convert(int* a) { return (*a)++; } int main(){ int m = 56; int n = convert(&m); cout << m << endl; m = convert(&m); cout << m &...
KingBob's user avatar

15 30 50 per page
1
2 3 4 5