الهياكل والفصول
الهياكل
هيكل عبارة عن مجموعة من العناصر من أي نوع (ما عدا الفراغ نوع). وبالتالي، فإن هيكل يجمع البيانات ذات الصلة منطقيا من أنواع مختلفة.
إعلان هيكل
يتم تحديد نوع البيانات بنية من الوصف التالي:
البنية structure_name
{
elements_description
}؛
لا يمكن استخدام اسم هيكل كمعرف (اسم متغير أو وظيفة). وتجدر الإشارة إلى أنه في MQL5 عناصر هيكل تتبع بعضها البعض مباشرة، دون المحاذاة. في C ++ يتم مثل هذا الأمر إلى مترجم باستخدام التعليمات التالية:
#pragma حزمة (1)
إذا كنت تريد أن تفعل محاذاة أخرى في الهيكل، واستخدام أعضاء المساعد، "الحشو" إلى الحجم الصحيح.