当前位置:网站首页>二维数组中的元素求其存储地址
二维数组中的元素求其存储地址
2022-07-03 02:59:00 【夏赞恩】
数组a[m][n] 按行序为主序存放
已知二维数组a[m][n]按行序为主序存放,每个元素占L个字符,其中首地址为a[x][y]地址为Loc1,元素a[i][j]的地址为:
Loc(a[i][j]) = Loc1 + [n*(i-x)+(j-y)]*L
数组a[m][n] 按列序为主序存放
已知二维数组a[m][n]按列序为主序存放,每个元素占L个字符,其中首地址为a[x][y]地址为Loc2,元素a[i][j]的地址为:
Loc(a[i][j]) = Loc2 + [m*(j-y)+(i-x)]*L
例题
(1)已知二维数组a[5][4]按行序为主序存放,每个元素占6个字符,其中首地址为a[1][1]地址为120,元素a[4][2]的地址为:
Loc(a[4][2]) = 120 + [4*(4-1)+(2-1)]*6 = 198
(2)已知二维数组a[10][20]按列序为主序存放,每个元素占1个字符,其中首地址为a[0][0]地址为120,元素a[6][12]的地址为:
Loc(a[6][12]) = 120 + [10*12+6]*1 = 246
边栏推荐
- Linear rectification function relu and its variants in deep learning activation function
- ComponentScan和ComponentScans的区别
- leetcode540
- 左值右指解释的比较好的
- Wechat - developed by wechat official account Net core access
- I2C 子系統(四):I2C debug
- 内存泄漏工具VLD安装及使用
- [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
- Summary of interview project technology stack
- 模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
猜你喜欢
![[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)](/img/65/c1fe95f8c391394f7ff1b75c7d75b6.jpg)
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)

Classes and objects - initialization and cleanup of objects - constructor call rules
![[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

Sqlserver row to column pivot

From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character
![[principles of multithreading and high concurrency: 1_cpu multi-level cache model]](/img/c7/6b5ab4ff7379bfccff7cdbb358ff8f.jpg)
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
![ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc](/img/cb/145937a27ef08050a370d5a255215a.jpg)
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc

用docker 連接mysql的過程

Add automatic model generation function to hade

A2L file parsing based on CAN bus (2)
随机推荐
JMeter performance test JDBC request (query database to obtain database data) use "suggestions collection"
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
Source code analysis | resource loading resources
I2C 子系统(一):I2C spec
SQL server queries the table structure of the specified table
Installation and use of memory leak tool VLD
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
tensorflow转pytorch笔记;tf.gather_nd(x,y)转pytorch
分布式事务
The difference between left value and right value in C language
SQL Server Query spécifie la structure de la table
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
从C到Capable-----利用指针作为函数参数求字符串是否为回文字符
Process the dataset and use labelencoder to convert all IDs to start from 0
Sqlserver row to column pivot
I2C 子系統(四):I2C debug
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)