#include <iostream>
class Foo{
public:
void bar(){
std::cout << "Hello" << std::endl;
}
int max(int num1,int num2)
{
// local variable declaration
int result;
if (num1 > num2)
result = num1;
else
result = num2;
return result;
}
};
extern"C" {
Foo* Foo_new(){ returnnew Foo(); }
void Foo_bar(Foo* foo){ foo->bar(); }
int Foo_max(Foo* foo){ foo->max(int num1,int num2); }
}
after compiling it is giving error as :
foo.cpp: In function ‘int Foo_max(Foo*)’:
foo.cpp:26:37: error: expected primary-expression before ‘int’
foo.cpp:26:46: error: expected primary-expression before ‘int’