From: Simon Krahnke Date: 2009-11-01T02:35:42+09:00 Subject: Re: Ruby doesn't implement x++ for Fixnum's because ??? * Robert Klemme (23:19) schrieb: > Yes - and in C++ you can have it otherwise: > > robert@fussel:~$ g++ x.cc && ./a.out > a++=1 > a=2 > b=2 > robert@fussel:~$ cat x.cc > > #include > > int main( int argc, const char* argv[] ) > { > int a = 1; > int &b = a; > printf("a++=%d\n", a++); > printf("a=%d\n", a); > printf("b=%d\n", b); > return 0; > } No, you can't: $ ./ab a: 2 @ 0xbfe413f8 b: 2 @ 0xbfe413f8 $ cat ab.cc #include int main(void) { int a = 1; int &b = a; a++; std::cout << "a: " << a << " @ " << &a << std::endl; std::cout << "b: " << b << " @ " << &b << std::endl; return 0; } There is only one variable, b is just another name for it. mfg, simon .... l