diff --git a/01-inline-functions/inline.cpp b/01-inline-functions/inline.cpp index 2406686..cfba2f9 100644 --- a/01-inline-functions/inline.cpp +++ b/01-inline-functions/inline.cpp @@ -1,13 +1,12 @@ #include -#include -inline void print_prog(char *prog_name) +inline int __attribute__((always_inline)) sum(int a, int b) { - std::cout << "Program name: " << prog_name << std::endl; + return a + b; } -int main(int argc, char *argv[]) +int main() { - print_prog(argv[0]); + int aux = sum(7,9); return EXIT_SUCCESS; } diff --git a/01-inline-functions/no-inline.cpp b/01-inline-functions/no-inline.cpp index ea3cec1..336bb2e 100644 --- a/01-inline-functions/no-inline.cpp +++ b/01-inline-functions/no-inline.cpp @@ -1,13 +1,12 @@ #include -#include -void print_prog(char *prog_name) +int sum(int a, int b) { - std::cout << "Program name: " << prog_name << std::endl; + return a + b; } -int main(int argc, char *argv[]) +int main() { - print_prog(argv[0]); + int aux = sum(7,9); return EXIT_SUCCESS; }