인생마린
어떤 공부 블로거의 금서목록
인생마린
전체 방문자
오늘
어제
  • 전체 (155)
    • C언어 (19)
    • Python (14)
      • Flask (0)
    • Coding Challenge (11)
      • Code Clone & Review (0)
      • Toy Project (0)
      • 오늘의 코드 (5)
    • Algorithm (6)
    • JAVA (8)
    • 웹 (8)
      • Javascript (3)
    • 정보보안 (19)
    • 기타 (21)
    • 일기는일기장에 (2)
    • 리눅스 (4)
    • 철학 (1)
    • 주식 (14)
    • AI (2)
    • 독후감 (13)
    • 프로그래밍 (4)
    • 게임 (1)
    • Devops (2)
      • CI_CD (2)
      • AWS (0)
    • Flutter (3)

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

태그

  • 폭락
  • 가상화폐
  • vpn
  • Flutter
  • 불편한사회
  • 주식 #배당주
  • Sphinx
  • 테라
  • 우영우 #패러디논란
  • turtle
  • 퀴즈봇
  • Regex
  • 주식 #ETF
  • 카카오톡봇
  • Regular Expression
  • 비트코인
  • TFT
  • 해커톤
  • 주린이 #주식
  • 정규표현식
  • flask
  • 백테스팅
  • python #eval #dictionary
  • Java
  • Bitcoin
  • smtplib
  • Python
  • best of best
  • 코인
  • c언어

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
인생마린

어떤 공부 블로거의 금서목록

C언어

[C언어]assert.h 에 대해 알아보자

2017. 5. 28. 21:59
반응형


assert.h 는  C 언어 전처리기 매크로 중 하나이며 이 매크로는 표명을 구현하여 프로그램이 추정한 것을 확인하며 거짓인 경우 진단 메시지를 출력한다.




void assert(int expression)

This is actually a macro and not a function, which can be used to add diagnostics in your C program.


예시

#include <stdio.h>
#include <assert.h>

int test_assert(int x)
{
    assert(x <= 4);
    return x;
}

int main()
{
    int i;

    for (i=0; i<=9; i++)
    {
        test_assert(i);
        printf("i = %d\n", i);
    }

    return 0;
}


결과


i = 0
i = 1
i = 2
i = 3
i = 4
assert: assert.c:6: test_assert: Assertion `x <= 4' failed.
Aborted


출처 : https://en.wikipedia.org/wiki/Assert.h

반응형
저작자표시 비영리 (새창열림)

'C언어' 카테고리의 다른 글

[C언어]conio.h 에 대해 알아보자  (0) 2017.05.28
[C언어]ctype.h 에 대해 알아보자  (0) 2017.05.28
[C언어] math.h 에 대해 알아보기  (0) 2017.05.28
[C언어] stdio.h 에 대해 알아보기  (0) 2017.05.28
[C언어] stdlib.h 헤더에 대해 알아보기  (0) 2017.05.28
    'C언어' 카테고리의 다른 글
    • [C언어]conio.h 에 대해 알아보자
    • [C언어]ctype.h 에 대해 알아보자
    • [C언어] math.h 에 대해 알아보기
    • [C언어] stdio.h 에 대해 알아보기
    인생마린
    인생마린
    즐거운 프로그래밍~♬

    티스토리툴바