I have a couple of source files, which are to be executed in a single source file; On calling functions in other source files from the executing source file, I get the syntax error C2059.
The executing source file is shown below:
I don't understand why I get this error. The function prototypes have already been defined in the header file: "homogeneous.h", as:
I'd appreciate any help. Thanks.
The executing source file is shown below:
Code:
#include <math>
#include "stdafx.h"
#include "Kuchuk.h"
#include "KuchukDlg.h"
#include "homogeneous.h"
#include <iostream>
using namespace std;
double PI = 3.141592653589793238462643383279502884197;
float zw,zs;
double ghomo[1];
double gh;
static int K;
double homo(double phi_u[],double phi_d[],double v[],double H_ft[],float zw,float zs)
{
CKuchukDlg MyClass;
MyClass.m_iSLayer = K;
MyClass.m_fZs = zs;
MyClass.m_fZw = zw;
double A[1],B[1],C[1];
gh = 0.0;
phi_u[K] = phiu(phi_u[],R[],v[],H_ft[]);//error C2059: syntax error: ']'
phi_d[K] = phid(phi_d[],R[],v[],H_ft[]);//error C2059: syntax error: ']'
A[K]= 1/(1-(phi_u[K]*phi_d[K]*exp(-2.0*v[K]*H_ft[K])));
B[K]=(1+(phi_d[K]*exp(-2.0*v[K]*zw)))*(phi_u[K]*exp(-2*v[K]*zs));
C[K]=(1+(phi_u[K]*exp(-2.0*v[K]*zs)))*(phi_d[K]*exp(-2*v[K]*zw));
ghomo[K]=((PI/4.0)*A[K])*(B[K]+C[K]);
gh += ghomo[K];
return gh;
}
Code:
extern double phiu(double phi_u[],double R[],double v[],double H_ft[]);
extern double phid(double phi_d[],double R[],double v[],double H_ft[]);
I'd appreciate any help. Thanks.