fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class to_be_exported{
  5. public:
  6. int do_something(int a){
  7. return a * 2;
  8. }
  9. };
  10.  
  11. extern "C" int do_something_exported(int a){
  12. static to_be_exported c;
  13. return c.do_something(a);
  14. }
  15.  
  16. int main() {
  17. /*
  18. with C#, you DllImport do_something_exported and call it
  19. */
  20. return 0;
  21. }
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty