ReLor2:
Hello,
i try to find a answear if it is possible to change a defined structure, later maybe to add a new element to the struct?
Is it possible?
Hello,
i try to find a answear if it is possible to change a defined structure, later maybe to add a new element to the struct?
Is it possible?
maybe later i need a another structure element for example
float value_float;"
Is it possible to check if this element already exists in structure and if not, to add it?
Thanks!
of course you can edit a structure just as you can edit any code
ReLor2: Is it possible to check if this element already exists in structure and if not, to add it?
Structures and Classes are defined at compile time, not at run-time.
It is you as the coder, that looks at the code text and decides to "modify, edit or change" it.
It is not something that is done during the code execution or run-time.
Fernando Carreiro #:
Structures and Classes are defined at compile time, not at run-time.
It is you as the coder, that looks at the code text and decides to "modify, edit or change" it.
It is not something that is done during the code execution or run-time.
Hi,
i'm a little bit confused about the two answears, let me make a smal example.
struct struct_ar { string fieldname; // Name of the field, also for headline int value_int; // Value of field, integer double value_double; // Value of field, double string value_string; // Value of field, string }; struct_ar myarray[1]; start=0; void OnTick() { if(start==0) { //let me use the origin structure myarray[0].fieldname="abc"; start++; } else { //Now i want to add a new element to the structure myarray[0].newfield="abc"; //This is not possible and failed because the field "newfield" isnt in my structure. //Ist it possible to add a new element in a structure wich is defined in global scope? } }
There is no “newfield” in the structure. Your code will not compile. You must add it and recompile. | struct struct_ar { string fieldname; // Name of the field, also for headline int value_int; // Value of field, integer double value_double; // Value of field, double string value_string; // Value of field, string }; |
ok, thanks a lot. that was my main question to know if it is possible to change a structure after compile it or not.

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
i try to find a answear if it is possible to change a defined structure, later maybe to add a new element to the struct?
Is it possible?