当前位置:网站首页>The use of C language typedef 】 : structure, basic data types, and array
The use of C language typedef 】 : structure, basic data types, and array
2022-08-09 11:16:00 【XV_】
typedef basic data type
typedef int a;a abc;
The following a abc
is equivalent to int abc
typedef structure
typedefstruct a {int a;int b;}abc;abc aaa;
For the above, abc aaa;
is equivalent to struct a aaa;
In short, the essence of typedef is to build an equivalence relation.
The first example, let a
and int
be equivalent;
The second example, let abc
and struct a { int a; int b; };
equivalent;
This simplifies writing .
There are special cases, however, when using arrays.
typedef array
typedef int a[5];a aa;
Here a aa
is equivalent to int aa[5]
, where the essence of aa is array of int type with 5 elements.
That is to say, typedef int a[5];
, making a
equivalent to int[5]
, of course, C language does notThis way of writing, I hope to understand, a
represents an array with 5 elements of type int.
typedef struct desc_struct{unsigned long a, b;}desc_table[256];desc_table idt, gdt;
Here idt
is struct desc_struct idt[256]
, and the same is true for gdt
.
边栏推荐
- People | How did I grow quickly from programmer to architect?
- 备份mongodb数据库(认证)
- x86异常处理与中断机制(1)概述中断的来源和处理方式
- 全网最简单解决OneNote中英字体不统一
- 依赖注入(Dependency Injection)框架是如何实现的
- CentOS6.5 32bit安装Oracle、ArcSde、Apache等配置说明
- 自从我使用HiFlow场景连接器后,在也不用担心成为“落汤鸡”了
- gdb tui的使用
- golang源代码阅读,sync系列-Pool
- Tensorflow realize parameter adjustment of linear equations
猜你喜欢
随机推荐
性能测试(03)-JDBC Request
Preparation for gold three silver four: how to successfully get an Ali offer (experience + interview questions + how to prepare)
ICML 2022 | Out-of-Distribution Detection with Deep Nearest Neighbors
在线编译matlab,亲测好用
为什么组合优先于继承
Missing URI template variable ‘employeeNumber‘ for method parameter of type String
torch.cat()函数的官方解释,详解以及例子
Create a table in a MySQL database through Doc
详细的np.matmul / np.dot / np.multiply / tf.matmul / tf.multiply / *
MATLAB中如何把cftool拟合的函数输出到命令行(解决如何导出拟合后的曲线数据)
PTA 计算天数
ACM01背包问题
API接口是什么?API接口常见的安全问题与安全措施有哪些?
gdb 10.2的安装
Solve 1. tensorflow runs using CPU but not GPU 2. GPU version number in tensorflow environment 3. Correspondence between tensorflow and cuda and cudnn versions 4. Check cuda and cudnn versions
【VIBE: Video Inference for Human Body Pose and Shape Estimation】论文阅读
性能测试(04)-表达式和业务关联-JDBC关联
1009 Product of Polynomials C语言多项式乘积(25分)
排序--快排(图解)
gdb tui的使用