I want to write this formula that can caculate the face address of array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I want to write this formula that can caculate the face address of array

[☆(A-L)*capacity of right hand]*n+a ☆ : sigma input parameter : upeer : u lower : L Andis off array : a n = how many byte of one charecter A[10][5] is the array and we want to know the address of this location A[3][4] and it work in this way [(3-0)*4+(4_0)]*4*1000

27th Apr 2018, 6:06 AM
a.balagar
a.balagar - avatar
4 Answers
+ 1
متوجه منظورت نشدم، فارسی بنویس
27th Apr 2018, 7:09 AM
🇮🇷 M N
0
محاسبه آدرس ظاهری آریه چند بعدی فقط پیاده سازی این فرموله بالاس : از کاربر حد بالا و حد پایین و آدرس اولین خونه تو حافظه و اندازه هر بایت از خونه های آرایه رو بگیره و آدرس اندیسی از آرایه که کاربر میخوادو بهش بده
28th Apr 2018, 4:29 PM
a.balagar
a.balagar - avatar
0
Amirhossein: // ConsoleApplication4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> using namespace std; int main() { int n,address; int temp = 0; int a = 1000; int h = 4; cout « "please Enter the dimension\n"; cin » n; for (int i = 1; i<= n; i++) { int u, l, a,cap; cout « "Please Enter the upper \n"; cin » u; cout « "upper : "«u«endl; cout « "Please Enter the lower \n"; cin» l; cout « "lower : "«l«endl; cout « "please enter the andis :\n"; cin » a; cout « "please enter the capacity of right hand\n"; cin » cap; temp =temp + (a - l)*cap; } address = (temp*h) + a; cout « "Address : " « address«endl; system("pause"); return 0; }
28th Apr 2018, 4:30 PM
a.balagar
a.balagar - avatar
0
یه برنامه مثل این فقط ابعاد دست راست و چپ رو کاربر وارد نکنه خودش محاسبه بشه (u-l)+1
28th Apr 2018, 4:31 PM
a.balagar
a.balagar - avatar