void clear(string &myArray[], int size) { }
Yes whoreder,
I did a mistake in writing my post... in my code, (those it does not compile) I correctly wrote
void clear(string &myArray[], int size) { }
But it does not compile.
Could you help me, please ?
Yes whoreder,
I did a mistake in writing my post... in my code, (those it does not compile) I correctly wrote
But it does not compile.
Could you help me, please ?
Delta, if you wrote something like
bool isNewBar = isNewBar();
void isNewBar() { … }
the compiler does not complain. However, when it is
bool isNewBar = isNewBar(2);
void isNewBar(int var1) { … }
you have this error.
Since you used 'clear' as the function name, a rather ordinary word, maybe you have declared a variable with the same name. If this is what happened, just rename the function to isNewBar_ (or whatever you like).
I know this is a late answer, but it may help those who come here looking for a solution to their problem.
There's a strong possibility that you have a (possibly globally declared) variable with the same name as the function.
This error may also show up if two variables, one in a function declaration (such as 'size' in your case), and a globally declared variable have the same name.
To those who came here, this also happens when you dont set brackets in function definition, it thinks it is not array and expects something
bool isEmaDowntrend(float emaFasterArray, float emaSlowerArray) { return emaFasterArray[0] < emaFasterArray[0]; } // Should be this: bool isEmaDowntrend(float& emaFasterArray[], float& emaSlowerArray[]) { return emaFasterArray[0] < emaFasterArray[0]; }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello to everybody,
I am getting mad in dealing with array passing to a function.
I have defined a function called clear(), with the following prototype
and defined in such way:
But when I call the clear function
I got this compilation error:
'clear -some operators expected'
What does it mean ?
How could I fix it ?