update
This commit is contained in:
12
2025.07.28_programming_with_python_and_cpp/example.cpp
Normal file
12
2025.07.28_programming_with_python_and_cpp/example.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(example, m) {
|
||||
m.def("add", &add, "A function that adds two numbers");
|
||||
m.def("hello", []() {
|
||||
return "Hello from C++!";
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user