Files
2nd/10_Wiki/Dev/Topic_C/C_Operators_Comparison.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

3.5 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
c-operators-comparison C Comparison Operators Programming_Language draft conceptual
== != > <
boolean 1 or 0
C 비교 연산자
B 0.85 2026-07-04 2026-07-04
c
programming-language
w3schools
operators
comparison
https://www.w3schools.com/c/c_operators_comparison.php

C Comparison Operators

🎯 한 줄 통찰 (One-line insight)

Unlike languages with a dedicated bool/Boolean type, C's comparison operators return plain INTEGERS — 1 for true, 0 for false — meaning the result of x > y can be printed with %d just like any other int, stored in an int variable, and used in arithmetic, because C has no separate boolean type at this point in the tutorial; true/false IS just 1/0. [S1]

🧠 핵심 개념 (Core concepts)

  • Six comparison operators== (equal), != (not equal), > (greater than), < (less than), >= (greater or equal), <= (less or equal). [S1]
  • Integer return value — every comparison returns 1 (true) or 0 (false), printable with %d. [S1]
  • Practical decision-making use — comparisons are the mechanism for finding answers and making decisions in a program, foreshadowing the upcoming if/else chapters. [S1]

📖 세부 내용 (Details)

  • Basic greater-than check: int x = 5; int y = 3; printf("%d", x > y); // returns 1 (true). [S1]
  • Voting age eligibility check: int age = 18; printf("%d\n", age >= 18); // 1 (true) printf("%d\n", age < 18); // 0 (false). [S1]
  • Password length check: int passwordLength = 5; printf("%d\n", passwordLength >= 8); // 0 (false), too short. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • 비교 결과는 진짜 정수형: 별도의 불리언 타입 없이 비교 연산 결과가 그냥 1 또는 0인 정수로 반환된다는 점이 명시되며, 이는 이후 Booleans 챕터에서 더 자세히 다뤄질 예정임이 언급됨. [S1]

🛠️ 적용 사례 (Applied in summary)

투표 가능 연령 확인(age >= 18)과 비밀번호 길이 확인(passwordLength >= 8)이 원문에서 직접 실전 활용 사례로 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Comparison operators returning plain integers (1 or 0), used for real-world eligibility checks (C):

int age = 18;
printf("%d\n", age >= 18); // 1 (true), old enough to vote
printf("%d\n", age < 18);  // 0 (false)

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.85
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C Comparison Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).