bedingte compilierung, 2
This commit is contained in:
13
src/main.c
13
src/main.c
@@ -1,13 +1,18 @@
|
|||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
#define DEBUG
|
#define DEBUG 5
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int a=2, b=3, ergebnis;
|
int a=2, b=3, ergebnis;
|
||||||
ergebnis = (2*a) + (2*b);
|
ergebnis = (2*a) + (2*b);
|
||||||
#ifdef DEBUG
|
|
||||||
|
#if DEBUG >= 1
|
||||||
printf("* Debug: ergebnis = (2*%d) + (2*%d);\n", a, b);
|
printf("* Debug: ergebnis = (2*%d) + (2*%d);\n", a, b);
|
||||||
#else
|
|
||||||
printf("Das Ergebnis ist %d\n", ergebnis);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if DEBUG >= 2
|
||||||
|
printf("* Debug: a=%d, b=%d, ergebnis=%d\n", a, b, ergebnis);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf("Das Ergebnis ist %d\n", ergebnis);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user