#include #ifdef WIN32 #define PLATFORM_EXPORT __declspec( dllexport ) #else #define PLATFORM_EXPORT #endif extern "C" int calc( char operation[20], int *operand1, int *operand2, int *result ); extern "C" int calc( char operation[20], int *operand1, int *operand2, int *result ){ if( !strcmp( operation, "add" )){ *result = (*operand1) + (*operand2) ; } else if( !strcmp( operation, "sub" )){ *result = (*operand1) - (*operand2) ; } else if( !strcmp( operation, "mul" )){ *result = (*operand1) * (*operand2) ; } else if( !strcmp( operation, "div" )){ *result = (*operand1) / (*operand2) ; } else{ *result = 0; return -1; } return 0; }