A simple question for fixes

I see the difference between prefix and suffix.

What's the difference with 'postfix'?

It seems to be just same with prefix so far.

thanks.
It seems to be just same with prefix so far.

No. Postfix means increment the variable after using the variable.
1
2
  int a = 3;
  int b = a++;

B is assigned the value of a before a is incremented. Therefore b is 3 and a is 4.
Prefix increment (preincrement): ++x
Postfix increment (postincrement) x++

prefix notation: + a b
infix notation: a + b
postfix notation: a b +

postfix is something written after expression
prefix is written before

Stere is no "suffix" in C++ at all, however some call postfix expressions suffix in analogy with linguistics
//AbstracftionAnon
Thanks, I got how postfix and prefix is different now : )

//MiiNiPaa
I have seen three words about increment and decrement, which are "postfix, prefix, and suffix" in the tutorial in right this site.
One of the examples here : http://www.cplusplus.com/doc/tutorial/pointers/
No offense I appreciate your answer, but it's in tutorial. is it synonym with postfix?
Yes, it is. As I said, some people use word suffix instead of postfix.
Thanks a lot !! : )
Topic archived. No new replies allowed.