当前位置:网站首页>Sequential representation of linear tables
Sequential representation of linear tables
2022-06-13 09:25:00 【Hezeze】
Dynamically distributed one-dimensional array , Using structures and pointers .
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
typedef struct {
int a;
float b;
} array;
typedef struct {
array *elem;
int length;
}SqList;
int main (void) {
SqList L;
int i=0;
L.elem=(array *)malloc(sizeof(array)*2 );
L.elem->a=1;
L.elem->b=3.2;
(L.elem+1)->a=2;
(L.elem+1)->b=6.4;
printf ("%d %f\n",L.elem->a,L.elem->b);
printf ("%d %f",(L.elem+1)->a,(L.elem+1)->b);
free(L.elem);
}
边栏推荐
- LeetCode 6096. Success logarithm of spells and potions (binary search)
- Longadder of the source code of JUC atomic accumulator
- (dp+ memory) acwing 901 skiing
- LeetCode 1. Sum of two numbers
- Collection of articles on virtualization and cloud computing
- Haproxy + keepalived for high availability load balancing of MySQL
- 全新BMW i3的操控,能符合对3系之名产品的期待吗?
- Yolov5 face video stream
- C # introductory series (XIII) -- getting to know the structure for the first time
- turtle库显示系统时间
猜你喜欢

(bfs) acwing 847. Hierarchy of points in the graph

Routing - static routing

(Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I

C language: five custom types

How Simulink adds modules to the library browser

(bfs) acwing 844. Labyrinth

Jenkins accédant à l'authentification de l'utilisateur openldap

20211020 academician all drive system

Exploitation of competitive loopholes in attacking and defending world PWN play conditions
![1-4 message passing interface [CSP authentication]](/img/db/aecda548693cdfb0e740bcf1a1c823.jpg)
1-4 message passing interface [CSP authentication]
随机推荐
7-3 virus traceability (20 points)
Solov2 nanny level tutorial (including environment configuration, training your own data set, code logic analysis, etc...) Updating ing
Yolov5 face learning notes
20211104 why is the trace of a matrix equal to the sum of eigenvalues, and why is the determinant of a matrix equal to the product of eigenvalues
LeetCode 583. 两个字符串的删除操作
20211108 det(AB)=det(A)det(B)
拜登:希望尽快签署两党枪支安全改革法案
LeetCode 201. 数字范围按位与
20211028 adjustment and tracking
LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
How Simulink adds modules to the library browser
C language: Address Book
Jenkins接入Openldap用戶認證
CAS NO lock
JS【中高级】部分的知识点我帮你们总结好了
攻防世界PWN play 条件竞争漏洞的利用
Necessary and sufficient conditions for diagonalization of 20211115 matrix; The full rank matrix does not necessarily have n linearly independent eigenvectors; Symmetric matrices must be diagonalized
C language 7-13 day K candle chart (15 points)
Cisco, Huawei network equipment
(Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I