Change array.size() to ArraySize(array)
It looks like you're trying to define a function `test` that takes an array of `OrderObject` objects as a parameter. However, the syntax you've used for passing the array reference `OrderObject& array[]` is not valid in C++. Instead, you can pass an array pointer or a reference to an array. Here's an example using a reference to an array:
```cpp
void test(OrderObject (&array)[], int size) {
for (int i = 0; i < size; i++) {
// do something here with array[i]
}
}
```
In this example, `OrderObject (&array)[]` declares a reference to an array of `OrderObject` objects, and `int size` is used to specify the size of the array. You would call this function like `test(myArray, arraySize)`, where `myArray` is your array of `OrderObject` objects and `arraySize` is the size of the array.
Alternatively, if you want to pass an array pointer, you can do it like this:
```cpp
void test(OrderObject* array, int size) {
for (int i = 0; i < size; i++) {
// do something here with array[i]
}
}
```
And call it as `test(myArray, arraySize)`, where `myArray` is a pointer to your array of `OrderObject` objects and `arraySize` is the size of the array.
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
Hey Guys,
im struggeling on a realy simple problem but can't find a solution. I have this simple code:
This gives me the errors:
'array' - invalid array access
'size' - function not defined
Can anyone tell me what im doing wrong here?