달력

3

« 2024/3 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'삽질예방/유용한 C defines'에 해당되는 글 1

  1. 2008.03.20 useful C defines
2008. 3. 20. 14:12

useful C defines 삽질예방/유용한 C defines2008. 3. 20. 14:12

__STRING(expr) expr에 해당하는 모든내용을 문자열로 치환해준다.
__FILE__, 파일명(const char*)
__LINE__, 라인넘버 (int)

#include <stdio.h>
#define DELTAKAM
...
printf("%s", __STRING(DELTAKAM));
printf("%s,%d", __FILE__, __LINE__);
...



출력

DELTAKAM
1.cpp,13



 

:
Posted by Kwang-sung Jun