Add inline function sources.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-05-06 11:29:09 +02:00
parent 15ba8e9d9a
commit fddc7e51ad
3 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,13 @@
#include <cstdlib>
#include <iostream>
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;
}

View File

@ -0,0 +1,13 @@
#include <cstdlib>
#include <iostream>
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;
}

View File

@ -1,6 +1,6 @@
CPP=g++ 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) all: $(EXEC)