Avi: How to add a string with specific size, to structure?
In MQL, strings do not have a predefined allocation size. They can grow or shrink as needed.
If you want them to have a specific size, then just assign fixed size strings to the variable.
#include <fxsaber\SingleTesterCache\String.mqh> // https://www.mql5.com/ru/code/27611 struct A { STRING128 Str; }; void OnStart() { A a; string Str = "Hello World!"; a.Str = Str; Print(a.Str[]); };
Thank you
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
How to add a string with specific size, to structure?