Browse Source

einbinden weiterer Dateien

lookup-tables
Stephan Richter 7 years ago
parent
commit
e66a1535bf
  1. 13
      src/funktionen.h
  2. 16
      src/main.c

13
src/funktionen.h

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
#ifndef FUNKTIONEN_H
#define FUNKTIONEN_H
int mult(int a, int b) {
return a * b;
}
int add(int a, int b) {
return a + b;
}
#endif

16
src/main.c

@ -1,18 +1,8 @@ @@ -1,18 +1,8 @@
#include<stdio.h>
#define DEBUG 5
#include "funktionen.h"
int main() {
int a=2, b=3, ergebnis;
ergebnis = (2*a) + (2*b);
#if DEBUG >= 1
printf("* Debug: ergebnis = (2*%d) + (2*%d);\n", a, b);
#endif
#if DEBUG >= 2
printf("* Debug: a=%d, b=%d, ergebnis=%d\n", a, b, ergebnis);
#endif
printf("Das Ergebnis ist %d\n", ergebnis);
printf("Produkt: %d\n", mult(4, 5));
printf("Summe: %d\n", add(4, 5));
return 0;
}

Loading…
Cancel
Save