النتائج 1 إلى 4 من 4
  1. #1
    الصورة الرمزية fxtrade44
    fxtrade44 غير متواجد حالياً موقوف
    تاريخ التسجيل
    Aug 2019
    الإقامة
    السعودية
    المشاركات
    14

    افتراضي تغيير قيمة Array اواجه مشكلة في الكود

    السلام عليكم ورحمه الله وبركاته
    I will write in english so the arrangment will be correct
    suppose I have the variable LotVal[7]={ .1 .2 .4 .8 1.6 3.2 6.4};
    now a condition happens and I want to change the values of the array to Lotval[7]= {.2 .4 .8 1.6 3.2 6.4 12 };
    how to do it i have problem in my code i can not assigned it
    what is the solution

  2. #2
    الصورة الرمزية goldfile
    goldfile غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Mar 2007
    الإقامة
    سانت لوسيا
    المشاركات
    752

    افتراضي

    اقتباس المشاركة الأصلية كتبت بواسطة fxtrade44 مشاهدة المشاركة
    السلام عليكم ورحمه الله وبركاته
    I will write in english so the arrangment will be correct
    suppose I have the variable LotVal[7]={ .1 .2 .4 .8 1.6 3.2 6.4};
    now a condition happens and I want to change the values of the array to Lotval[7]= {.2 .4 .8 1.6 3.2 6.4 12 };
    how to do it i have problem in my code i can not assigned it
    what is the solution
    كود PHP:
    void OnStart()
      {
    //--- declare dynamic array
       
    int a[];
    //--- set size
       
    ArrayResize(a,10);
    //--- fill first 5 elements with 123
       
    ArrayFill(a,0,5,123);
    //--- fill next 5 elements with 456
       
    ArrayFill(a,5,5,456);
    //--- show values
       
    for(int i=0;i<ArraySize(a);i++) printf("a[%d] = %d",i,a[i]);
      } 

  3. #3
    الصورة الرمزية fxtrade44
    fxtrade44 غير متواجد حالياً موقوف
    تاريخ التسجيل
    Aug 2019
    الإقامة
    السعودية
    المشاركات
    14

    افتراضي

    اقتباس المشاركة الأصلية كتبت بواسطة goldfile مشاهدة المشاركة
    كود PHP:
    void OnStart()
      {
    //--- declare dynamic array
       
    int a[];
    //--- set size
       
    ArrayResize(a,10);
    //--- fill first 5 elements with 123
       
    ArrayFill(a,0,5,123);
    //--- fill next 5 elements with 456
       
    ArrayFill(a,5,5,456);
    //--- show values
       
    for(int i=0;i<ArraySize(a);i++) printf("a[%d] = %d",i,a[i]);
      } 
    شكرا لك اخي الكريم , لكن انا اريد تغيير كامل قيمة array ب واحد اخر
    for eample A[7]={1,2,3,4,5,6,7,8}
    B[7]={2,3,4,5,6,7,8,9};

  4. #4
    الصورة الرمزية goldfile
    goldfile غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Mar 2007
    الإقامة
    سانت لوسيا
    المشاركات
    752

    افتراضي

    اخي الكريم

    اسند القيم التي تريد للمصفوفة a في declaration وكذلك بالنسبة للمصفوفة b واعمل لوب لتغيير عناصر المصفوفة بنفس الطريقة

    حاول ويستعمل ذلك بسهولة تقبل ودي


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17