当前位置:网站首页>Find the storage address of the elements in the two-dimensional array
Find the storage address of the elements in the two-dimensional array
2022-07-03 03:00:00 【Shazanen】
List of articles
Array a[m][n] Store in main order in line order
Known two-dimensional array a[m][n] Store in main order in line order , Each element accounts for L Characters , The first address is a[x][y] The address is Loc1, Elements a[i][j] The address for :
Loc(a[i][j]) = Loc1 + [n*(i-x)+(j-y)]*L
Array a[m][n] Store in the main order according to the column order
Known two-dimensional array a[m][n] Store in the main order according to the column order , Each element accounts for L Characters , The first address is a[x][y] The address is Loc2, Elements a[i][j] The address for :
Loc(a[i][j]) = Loc2 + [m*(j-y)+(i-x)]*L
Example
(1) Known two-dimensional array a[5][4] Store in main order in line order , Each element accounts for 6 Characters , The first address is a[1][1] The address is 120, Elements a[4][2] The address for :
Loc(a[4][2]) = 120 + [4*(4-1)+(2-1)]*6 = 198
(2) Known two-dimensional array a[10][20] Store in the main order according to the column order , Each element accounts for 1 Characters , The first address is a[0][0] The address is 120, Elements a[6][12] The address for :
Loc(a[6][12]) = 120 + [10*12+6]*1 = 246
边栏推荐
- SQL statement
- [principles of multithreading and high concurrency: 1_cpu multi-level cache model]
- A2L file parsing based on CAN bus (2)
- Counter统计数量后,如何返回有序的key
- 当lambda没有输入时,是何含义?
- Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
- SQL Server Query spécifie la structure de la table
- ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
- TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
- [C语言]给账号密码进行MD5加密
猜你喜欢

I2C subsystem (I): I2C spec

SQL statement
![[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling](/img/c3/b9a614001f80345a5c1cb3c68ab27c.jpg)
[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling

Sous - système I2C (IV): débogage I2C

Docker install MySQL

你真的懂继电器吗?

sql server数据库添加 mdf数据库文件,遇到的报错

Add automatic model generation function to hade

Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!

Creation and destruction of function stack frame
随机推荐
二维格式数组格式索引下标连续问题导致 返回json 格式问题
How to limit the size of the dictionary- How to limit the size of a dictionary?
HTB-Devel
你真的懂继电器吗?
MySql实战45讲【全局锁和表锁】
Docker install redis
Counter统计数量后,如何返回有序的key
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
open file in 'w' mode: IOError: [Errno 2] No such file or directory
Kubernetes family container housekeeper pod online Q & A?
Opengauss database development and debugging tool guide
Change cell color in Excel using C - cell color changing in Excel using C
Concrete CMS vulnerability
Docker install MySQL
The core idea of performance optimization, dry goods sharing
力扣------网格中的最小路径代价
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
用docker 连接mysql的过程
Cancer biopsy instruments and kits - market status and future development trends
The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]