M
Michael Rasmussen
Hi all,
How do you make modules written i C++ available for C?
Until now I have done it this way:
foo.h
class foo {
public:
int bar();
}
foo.cc
int foo::bar()
{
return 1;
}
foo_c.h
int foo_c();
foo_c.cc
#include "foo.h"
foo f;
int foo_c()
{
return f.bar();
}
main.c
#include "foo_c.h"
int main()
{
printf("%d\n", foo_c());
return 0;
}
Any other suggestions?
How do you make modules written i C++ available for C?
Until now I have done it this way:
foo.h
class foo {
public:
int bar();
}
foo.cc
int foo::bar()
{
return 1;
}
foo_c.h
int foo_c();
foo_c.cc
#include "foo.h"
foo f;
int foo_c()
{
return f.bar();
}
main.c
#include "foo_c.h"
int main()
{
printf("%d\n", foo_c());
return 0;
}
Any other suggestions?