강의

멘토링

로드맵

Inflearn Community Q&A

mj441's profile image
mj441

asked

Learn C Programming by Following Along with Hong Jeong-mo

11.6 Various string functions

my_strcmp 함수 구현 질문 있습니다

Written on

·

311

0

따로 검색해본 코드인데 맨 마지막에서 두번째 줄에 삼항연산자 비슷하게 생겼는데 콜론이 두개고 어떻게 해석해야하는지 궁금합니다!

c

Answer 2

0

result변수에  cmp값이 양수이면 1을,  음수이면 -1을,  0이면 0을 대입한다. 

0

안녕하세요?

c 연산자 우선순위 : https://en.cppreference.com/w/c/language/operator_precedence

Ternary conditional 오퍼레이터 연산자 결합도를 생각해보면 알 수 있을 거 같습니다.

감사합니다.

mj441's profile image
mj441

asked

Ask a question