Hello all. I am new to this community and also to C programming. I am learning with the EPANET toolkit (EPANET 2_2.h) and I am using the IDE Codeblocks so I ask kindly you to bear with me if my question if too basic
I have a general problem with all the functions that I call on my script from the header Epanet2_2.h.
For example: as simple as a function to open the Epanet inp File.
This function is listed in the Epanet2_2.h header as:
int DLLEXPORT EN_open(EN_Project ph, const char inpFile, const char rptFile, const char outFile);
When I try to use this function in my script, I write it as:
int EN_open(EN_Project ph, “Filename.inp”, “”, “”); (no rpt files required in this case)
However, codeblocks returns the following error:
error: expected declaration specifiers or ‘…’ before string constant.
I am somehow using the function wrong but I have no idea why.
I did try to predefine the file name as a random variable as:
const char A = “Filename.inp”;
and then rewriting the function as:
int EN_open(EN_Project ph, A, “”, “”);
but that also get a similar error:
error: expected declaration specifiers or ‘…’ before A.
Can someone shed some light on this?
Thank you very much in advance.