"C언어 ifdef DEBUG"의 두 판 사이의 차이

(새 문서: ==개요== ;GCC #ifdef DEBUG ;C언어 #ifdef DEBUG ==참고== * https://stackoverflow.com/questions/987637/define-debug-1 분류: GCC 분류: C)
 
2번째 줄: 2번째 줄:
;GCC #ifdef DEBUG
;GCC #ifdef DEBUG
;C언어 #ifdef DEBUG
;C언어 #ifdef DEBUG
<source lang='console'>
root@zetawiki:~# cat hello_debug.c
#include <stdio.h>
int main() {
#ifdef DEBUG
printf("DEBUG!!!!\n");
#endif
printf("Hello World\n");
return 0;
}
</source>
<source lang='console'>
root@zetawiki:~# gcc hello_debug.c
root@zetawiki:~# ./a.out
Hello World
</source>
<source lang='console'>
root@zetawiki:~# gcc hello_debug.c -DDEBUG
root@zetawiki:~# ./a.out
DEBUG!!!!
Hello World
</source>


==참고==
==참고==

2017년 11월 23일 (목) 01:13 판

1 개요

GCC #ifdef DEBUG
C언어 #ifdef DEBUG
root@zetawiki:~# cat hello_debug.c
#include <stdio.h>
int main() {

#ifdef DEBUG
	printf("DEBUG!!!!\n");
#endif
	printf("Hello World\n");
	return 0;
}
root@zetawiki:~# gcc hello_debug.c
root@zetawiki:~# ./a.out
Hello World
root@zetawiki:~# gcc hello_debug.c -DDEBUG
root@zetawiki:~# ./a.out
DEBUG!!!!
Hello World

2 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}