/CppInC

An example project showing how to use C++ functions from C and how to compile and link them together.

Primary LanguageC++

C++ in C

Three examples of how to use C++ code from C:

  1. The simplest example: Simplest Possible Example
  2. A minimal example using a dynamically linked C++ library with a C++ class: Dynamic Linking OOP Example.
  3. An example showing how this all can be used to enable C to use PyTorch: LibTorch Example

The Makefiles are commented with some explanation and more info on this topic can be found here.