diff --git a/01_ENV/build-c.sh b/01_ENV/build-c.sh index 218240c..88ed7a4 100755 --- a/01_ENV/build-c.sh +++ b/01_ENV/build-c.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash bash clean.sh clang-6.0 -c func1.c main.c -lm clang-6.0 -s func1.o main.o diff --git a/01_ENV/func1.c b/01_ENV/func1.c index fb45c6a..0dc0564 100644 --- a/01_ENV/func1.c +++ b/01_ENV/func1.c @@ -4,8 +4,7 @@ #define func1 int func3(int x) { - //return pow(x, 3) - 3 * pow(x, 2) - x + 3; - return x + 10; + return pow(x, 3) - 3 * pow(x, 2) - x + 3; } int func2(int x) { @@ -25,4 +24,4 @@ int recurse2(int count) { printf("Recurse 2: %d\n", func3(count - 1)); return recurse1(count - 1); }else return 0; -} +} \ No newline at end of file diff --git a/01_ENV/main.c b/01_ENV/main.c index 5ed484e..90fdc1b 100644 --- a/01_ENV/main.c +++ b/01_ENV/main.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) { printf("Funktion 1: %d\n" ,func3(2)); printf("Funktion 2: %d\n" , func2(2)); - + int tmp = 0; for(int i = 0; i <= 5; ++i) { tmp += func3(i);