C의 신기한 연산자 -->

dl3zp3의 이미지

#include <stdio.h>
int main()
{
     int x = 10;
     while( x --> 0 ) // x goes to 0
     {
       printf("%d ", x);
     }
 
} 

ㅋㅋㅋㅋ
http://stackoverflow.com/questions/1642028/what-is-the-name-of-this-operator

7339989b62a014c4ce6e31b3540bc7b5f06455024f22753f6235c935e8e5의 이미지

!!은 어떠세요? :)

---8< 서명 -----------------
애니메이션 감상 기록 http://animeta.net/

vendor8의 이미지

저는 링크 안들어가보고 맞췄네요 ~ ㅎㅎ

맨발의 이미지

자.. 이제 신기한 연산자를 보여주세요. ㅡ_ㅡ+

--------------------------------------------
:: 누구보다 빠르게 남들과는 다르게

aero의 이미지

Perl의 신기한 연산자들 입니다.
( 실제로는 독립적인 연산자라고 하기보다 조합에 의해 재미있는 동작이 일어나는거지만..)
재미로 보세요

http://www.catonmat.net/blog/secret-perl-operators/

cppig1995의 이미지

That's a very complicated operator, so C++ Standard committee even placed it description in two different parts of Standard.

이 답변 센스있군요 ㅋ

int x = 10, y. z;
while(x -->> y -->> z) printf("%d ", x);

본문에 이 코드의 결과가 "9 8 7 "일 때 y와 z의 값을 묻는 문제가 있었는데, 답 알려주실 분?

> What is the difference between software and hard water?
} Bugs drown in hard water, but live forever in software.

Real programmers /* don't */ comment their code.
If it was hard to write, it should be /* hard to */ read.

pastime의 이미지

gcc에서는 2, 0 이군요..

freestyle의 이미지

-- 같은 게 한 수식에서 저렇게 사용되면 연산자 우선순위에 상관없이
평가순서가 (표준에) 정의되어 있지 않아 구현에 따라 달라지는 거 아닌가요?
제가 모르는 부분이 있는 건가요?
----------------------
Go to the U-City

----------------------------------------------------------------------------------------
Don't Feed the Trolls!
----------------------------------------------------------------------------------------

pastime의 이미지

일단 (x-- >> y--) 가 계산되고 나면
x와 y값 자체는 더이상 조건식에 영향을 주지 않기 때문에
상관없지 않을까요?