Anyone know C Programming?

I never did understand that ‘++’ operator.

It increases one… (after comparing it or returning it if it’s after the value… otherwise before…)

Oh… so it’s just like

variable += 1

Yep…

Actually, it’s not…

The special thing about variable++ is that it increments the variable, but the expression itself returns the value of the variable before being incremented.

So:


int x = 56;
int x2 = 56;
int y = x++;

y (56) == x2 (56) (TRUE)
x (57) == x2 (56) (FALSE)

So, C++ would suggest that C is being improved, but C++ is just the same as C :stuck_out_tongue:

yea I got to that page, but as I do not have irc and did not intend to download it, I used the ‘click here’ link… to a dead page :frowning:

so the actual irc channel/server is still around, yea?

[whisper]Whoa, this is awesome. Guess I’m a bit late, though[/whisper]

How can you not know what ++ and – do? It’s possibly the most simple operator in C++. And many other languages, for that matter.

for (int x = 0;x<peopleWhoDontKnow;x++)
{
cout<<“Read a tutorial.”<<endl;
}

… Ok, so that’s C++, not C.

λ: I said the same thing really briefly and shortly (I’m not sure if you understood my brilliantly concise language):