Last active
February 28, 2021 20:52
-
-
Save currencysecrets/a3028b16626d8540821a to your computer and use it in GitHub Desktop.
Handy Array Utility functions for MetaTrader 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void flushArray( int& arr[] ) { | |
ArrayInitialize( arr, 0 ); | |
ArrayResize( arr, 0 ); | |
} | |
// append new element to end of int array | |
void intArrayPush( int& arr[], int elem ) { | |
int size = ArraySize( arr ); | |
ArrayResize( arr, size + 1 ); | |
arr[ size ] = elem; | |
} | |
// remove last element of int array | |
void intArrayPop( int& arr[] ) { | |
int size = ArraySize( arr ); | |
ArrayResize( arr, size - 1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment