I have this function in the header of my .dll:
void calculo(vector<double> A, vector<int> B, double &Ans1, double jj);
in .cpp it is defined as follows
void calculo(vector<double> A, vector<int> B, double &Ans1, double jj = 36.5);
I'm calling the .dll from a c ++ code as follows.
insira o código aqui
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include "TEST_DLL.h"
typedef void(_stdcall *f_funci)(vector<double> A, vector<int> B, double &Ans1, double jj);
int main()
{
vector<double> A;
vector<int> B;
double ans1;
double teste;
HINSTANCE hGetProcIDDLL = LoadLibrary(L"MINHA_DLL.dll");
if (!hGetProcIDDLL) {
std::cout << "could not load the dynamic library" << std::endl;
return EXIT_FAILURE;
}
f_funci Resultado = (f_funci)GetProcAddress(hGetProcIDDLL, "calculo");
if (!Resultado) {
std::cout << "could not locate the function" << std::endl;
return EXIT_FAILURE;
}
Resultado(A,B, ans1, teste);
}
That way the function works, but if I do not provide the last input which is what already has a default value it does not compile. How would I indicate in my code that this function has a default value for this input?