Download MetaTrader 5

Help with global variables and classes

To add comments, please log in or register
We have launched Spanish and Portuguese versions of the website. Try them!
Mario Ezequiel Ginsberg
1468
Mario Ezequiel Ginsberg 2014.12.30 23:07 

First of all, I apologize for my poor english, I'm using the google translator to write this post.

This is my problem:

Imagine that i've this class:

class Example {
    int hello;
}

And I need to do something like this

extern int Aux;
Example ex;
ex.hello = Aux;

I want to know if there's a way to delete Aux because i'll never use it again (and it consumes memory). Or at least a way to assign a value to ex.hello from outside (extern mode).

Thank you very much! 

Taskin Osman
816
Taskin Osman 2015.01.08 10:59  
dont worry about 2 bytes of data. extern variables cannot be deleted, there is no usage
Carl Schreiber
6590
Carl Schreiber 2015.01.08 11:23  
You can only free arrays: ArrayFree()

It frees up a buffer of any dynamic array and sets the size of the zero dimension to 0.

To add comments, please log in or register