C의 신기한 연산자 -->
글쓴이: dl3zp3 / 작성시간: 수, 2009/12/30 - 9:27오후
#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
Forums:
!!은 어떠세요?
!!은 어떠세요? :)
---8< 서명 -----------------
애니메이션 감상 기록 http://animeta.net/
ㅎㅎ
저는 링크 안들어가보고 맞췄네요 ~ ㅎㅎ
자.. 이제 신기한
자.. 이제 신기한 연산자를 보여주세요. ㅡ_ㅡ+
--------------------------------------------
:: 누구보다 빠르게 남들과는 다르게
Perl의 신기한 연산자들
Perl의 신기한 연산자들 입니다.
( 실제로는 독립적인 연산자라고 하기보다 조합에 의해 재미있는 동작이 일어나는거지만..)
재미로 보세요
http://www.catonmat.net/blog/secret-perl-operators/
That's a very complicated
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.
undefined behavior겠지만
gcc에서는 2, 0 이군요..
음... 저 코드라면..
-- 같은 게 한 수식에서 저렇게 사용되면 연산자 우선순위에 상관없이
평가순서가 (표준에) 정의되어 있지 않아 구현에 따라 달라지는 거 아닌가요?
제가 모르는 부분이 있는 건가요?
----------------------
Go to the U-City
----------------------------------------------------------------------------------------
Don't Feed the Trolls!
----------------------------------------------------------------------------------------
위의 식에서는
일단 (x-- >> y--) 가 계산되고 나면
x와 y값 자체는 더이상 조건식에 영향을 주지 않기 때문에
상관없지 않을까요?