>> Edit article
이름
제목
패스워드
: : : int a = 10; : : : int s = 0; : : : : : : s = a++; : : : : : : printf("%d",s); : : : : : : 여기서 s값이 10이나오는것이 궁금합니다.. : : : : : : 연산자 우선순위로 볼때 a++ 이 먼저계산되고 그 값이 s에 들어갈것긑거든요.. : : : : : : 풀어서 쓴다고 해도 s = a = a + 1 이 되질 않나요? : : : : : : -_-;; 웨 10이 나오는지 -_-;; : : : : : : 아.. 저의 허접함이 밀려옵니다. ㅡㅜ : : : : 님이 원하시는 답은 s= ++a; 일경우입니다. : : : : ++a는 이걸 몬저 하고 s에 대입하는 거시고, : : a++은 일단 s에 대입후 ++하는 거시져. : : : : -- : : 아싸 가오리~ : : 답변감사합니다... : : 제가 궁금한건.. 우선순위가 분명히 a++이 먼저인대.. a가 먼저대입되는 이유지요.. : : -_-;; 혹시 우선순위가 쩔때루~ 그렇지 않을거라는 생각은 안해보셨는지... 긁적 긁적... MSDN에서 찾은거 올려드립니다. postfix-expression ++ The result of the postfix increment or decrement operation is the value of the 'postfix-expression'(a를 말합니다) before the increment or decrement operator is applied. The type of the result is the same as that of the postfix-expression but is no longer an l-value. After the result is obtained, the value of the operand is incremented (or decremented). 첫문장이 연산결과는 가감이 이루어지기전의 postfix-expression의 값으로 처리된다...임당... 도움되셨길.--아싸 가오리~
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved