当前位置:网站首页>C语言初阶(十)类型重命名typedef
C语言初阶(十)类型重命名typedef
2022-06-21 10:55:00 【咔咔公主】
一.基本类型重命名
typedef 类型 新名字;二.结构体/联合体类型重命名
typedef struct {
成员;
} 类型名;在typedef定义结构体同时,可以定义结构体指针。
typedef struct{
int x;
int y;
int z;
} Point3D,*pPoint3D;
Point3D p = {1,2,3};
pPoint3D q = &p;三.函数指针类型重命名
typedef 返回类型 (* 函数指针类型)(参数)例:
int add(int a,int b){return a+b;}
typedef int (*opt)(int,int); // 定义函数指针类型
opt fpadd = &add; // 定义函数指针并赋值
printf("%d\n",(*fpadd)(1,3));边栏推荐
- MySQL - library operation
- 中国国际电子商务中心与易观分析联合发布:2021年4季度全国网络零售发展指数同比增长0.6%
- 2. MySQL index optimization
- Eig and Saudi Aramco signed a memorandum of understanding to expand energy cooperation
- Do website from scratch 11- blog development
- Kotlin - Sequence 序列
- 开源FTP 服务器 FileZilla Server
- Matplotlib two methods of drawing torus!
- The third part of the procedure
- Add solid state to the computer
猜你喜欢

Matplotlib 绘制圆环图的两种方法!

Map集合遍历,添加替换,删除元素

WPF DataContext usage

Talk about the multimodal project of fire

Mqtt of NLog custom target

Dapr advanced-01-debug dapr

性能優化——圖片壓縮、加載和格式選擇

Simple implementation of Snake game in C language

功能测试怎么学?阿里工程师教4个步骤

MySQL 5.7 is about to be stopped and only maintained. It's time to learn a wave of MySQL 8
随机推荐
金融机构抢滩“数字员工”;保险APP适老化服务评测框架发布
Application configuration management, basic principle analysis
一行代码加速 sklearn 运算上千倍
Odd number of characters exception
What securities does qiniu use to open an account? Is it safe to open an account
Running view of program
Do you understand the capacity expansion mechanism of ArrayList?
Dapr advanced -02- view dapr logs
China's garment and textile manufacturing industry is facing severe challenges
MySQL - library operation
Citus 11 for Postgres is completely open source and can be queried from any node (citus official blog)
High concurrency - personal notes
MySQL 5.7 is about to be stopped and only maintained. It's time to learn a wave of MySQL 8
is not allowed to connect to this mysql server
Record an SVN error assertion `svn_ uri_ is_ canonical(child_uri, NULL)‘ failed.
Quick sorting, simple and easy to understand principle description, with C code implementation,
The first phase of takin open source training camp is coming! Teach you to complete the full link voltage test hand in hand!
送分题,ArrayList 的扩容机制了解吗?
东方甄选双语直播火爆出圈,新东方转型初见端倪
15+城市道路要素分割应用,用这一个分割模型就够了!