markdown_snippet_injector/processed_markdown.md
2026-02-04 14:09:41 +01:00

53 lines
1.1 KiB
Markdown

# Example markdown
Compare the processed version of this file with its unprocessed form.
## The includes
The includes are important to tell the compiler what to expect later. In the example file, the includes are :
```cpp
#include <iostream>
#include <factorial.h>
```
## The factorial function
The factorial function is implemented recursively. It is defined in another file called `factorial.cpp` :
```cpp
int factorial(int n) {
if (n <= 1) {
return 1;
}
return factorial(n-1) * n;
}
```
The corresponding header file is :
```cpp
#pragma once
int factorial(int n);
```
## Some other function
Some other function is implemented in the `example_code.cpp` file.
While the snippet is defined in the C++ file, we can decide to not use it in the documentation.
## Main function
In order to call all the functions defined above, the main function is implemented as such :
```cpp
int main() {
// Call the factorial function
std::cout << factorial(5) << std::endl;
// Call some_function
std::cout << some_function(3) << std::endl;
return 0;
}
```