Add inline function sources.
This commit is contained in:
parent
15ba8e9d9a
commit
fddc7e51ad
13
01-inline-functions/inline.cpp
Normal file
13
01-inline-functions/inline.cpp
Normal 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;
|
||||
}
|
13
01-inline-functions/no-inline.cpp
Normal file
13
01-inline-functions/no-inline.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user