diff --git a/01-inline-functions/inline.cpp b/01-inline-functions/inline.cpp new file mode 100644 index 0000000..2406686 --- /dev/null +++ b/01-inline-functions/inline.cpp @@ -0,0 +1,13 @@ +#include +#include + +inline void print_prog(char *prog_name) +{ + std::cout << "Program name: " << prog_name << std::endl; +} + +int main(int argc, char *argv[]) +{ + print_prog(argv[0]); + return EXIT_SUCCESS; +} diff --git a/01-inline-functions/no-inline.cpp b/01-inline-functions/no-inline.cpp new file mode 100644 index 0000000..ea3cec1 --- /dev/null +++ b/01-inline-functions/no-inline.cpp @@ -0,0 +1,13 @@ +#include +#include + +void print_prog(char *prog_name) +{ + std::cout << "Program name: " << prog_name << std::endl; +} + +int main(int argc, char *argv[]) +{ + print_prog(argv[0]); + return EXIT_SUCCESS; +} diff --git a/Makefile b/Makefile index cbff4b9..c10fe78 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CPP=g++ -EXEC := 00-const-vars/const.exe 00-const-vars/no-const.exe +EXEC := 00-const-vars/const.exe 00-const-vars/no-const.exe 01-inline-functions/inline.exe 01-inline-functions/no-inline.exe all: $(EXEC)