William210:
Hello How are you?
A little help please
I would like to work with the Carray class, but I find it penalizing that I can’t do a printarray on the array manipulated by the class.
So I wanted to make a template function that would have allowed me to do the arrayprint Here is the code
My problem is that I can’t write the declaration of the function
If you can help me with the syntax, or maybe a different solution to have the ArrayPrint of the class?
Thank you
Depends on how you call the function
This signature will only work, if you specify the type correctly, like you did at creating the CArray object
void PrintArray (CArray<T> &array)
You need to call it like this:
CArray<int> my_obj();
PrintArray<int>(my_obj);
Alternative you could do this:
void PrintArray (T &array)
And then call it like this:
PrintArray(array);
Thanks a lot
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 are you?
A little help please
I would like to work with the Carray class, but I find it penalizing that I can’t do a printarray on the array manipulated by the class.
So I wanted to make a template function that would have allowed me to do the arrayprint Here is the code
My problem is that I can’t write the declaration of the function
If you can help me with the syntax, or maybe a different solution to have the ArrayPrint of the class?
Thank you