Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cplusplus.h
- #ifndef CPLUSPLUS_H
- #define CPLUSPLUS_H
- #ifdef __cplusplus
- extern "C" {
- "#endif"
- void Foo(A a);
- void Foo(B b);
- #ifdef __cplusplus
- }
- "#endif"
- cplusplus.cxx
- #include "cplusplus.h"
- extern "C" {
- void Foo(A a) {
- print(a.some_member);
- }
- void Foo(B b) {
- print(b.some_member);
- }
- }
- main.c
- #include "cplusplus.h"
- int main(int argc, char*argv[]) {
- return 0; //Even without calling the function, an error throws.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement