It is very easy to find out yourself!
Just print out the relevant index of the array right before the array access and you would have got right away instead of waiting hours...
(Beside that you have three array accesses within a function how should we know how the array is defined (dynamic?) and where happens the error)
You're function is declared to return a single string, but you are trying to return an array (output_array) which can't be done. Thus the compile error Invalid access to an array (120) gooly, not the runtime ERR_ARRAY_INDEX_OUT_OF_RANGE (4002.) | string split_line(string& output_array[] , string bufferline , string delimiter) { : return( output_array ); |
output_array is passed by reference and is the output. Don't try to return a value. | void split_line(string& output_array[] , string bufferline , string delimiter) { : return; |
Or return the count. | int split_line(string& output_array[] , string bufferline , string delimiter) { : return c; |
Or better yet, use the built in StringSplit - MQL4 Documentation | int split_line(string& output_array[] , string bufferline , string delimiter){ return StringSplit(output_array, delimiter, bufferline); }Alphabetic Index of MQL4 Functions (600+) - MQL4 forum |

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
MY source can't compile an Eorror : Invalid array access
my source
it eorror output_array hiw cab fix.
Help me please.