Nelson Wanyama:
Hello.
How do I use an Array of type CArrayInt as parameters to a the method inside CFoo below?
?
I've got it thanks.
#include <Arrays\ArrayInt.mqh> //--- class CFoo { CFoo(CArrayInt *foo_ptr){ int total = foo_ptr.Total(); for(int i=0; i<total; i++) Print(foo_ptr.At(i); } ~CFoo(void){} } //--- void OnStart() { //--- how do I print CArrayInt array inside CFoo here? //answer CArrayInt *m_int = new CArrayInt(); //--- add some values to the array to have something to print out int total =5; for(int i =0; i<total; i++) m_int.At(i) = rand(); //--- CFoo m_foo(m_int); //--- delete m_int; }

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
Hello.
How do I use an Array of type CArrayInt as parameters to the method inside CFoo below?
?