النتائج 1 إلى 4 من 4
- 05-08-2019, 12:21 PM #1
تغيير قيمة 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
- 05-08-2019, 03:33 PM #2كود 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]);
}
- 05-08-2019, 03:42 PM #3
- 05-08-2019, 04:15 PM #4
اخي الكريم
اسند القيم التي تريد للمصفوفة a في declaration وكذلك بالنسبة للمصفوفة b واعمل لوب لتغيير عناصر المصفوفة بنفس الطريقة
حاول ويستعمل ذلك بسهولة تقبل ودي