当前位置:网站首页>C 在函数声明前加typedef
C 在函数声明前加typedef
2022-08-09 21:54:00 【ma_de_hao_mei_le】
友链
在学习驱动开发的时候看到下面这种代码
typedef
NTSTATUS
DRIVER_INITIALIZE (
_In_ struct _DRIVER_OBJECT *DriverObject,
_In_ PUNICODE_STRING RegistryPath
);
一开始看感觉很奇怪,不知道为啥前面要加一个typedef,后来网上搜了搜,看到下面这个问答
https://stackoverflow.com/questions/4295432/typedef-function-pointer

顿时就明白怎么回事了,我来自己举个例子
#include <stdio.h>
typedef int myfunc(int a);
myfunc b;
int main() {
printf("%d\n", b(123));
return 0;
}
int b(int a) {
return a;
}

边栏推荐
猜你喜欢

AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis

Reinforcement Learning Weekly Issue 57: DL-DRL, FedDRL & Deep VULMAN

2022年中国第三方证券APP创新专题分析

FileZilla搭建FTP服务器图解教程

ACM MM 2022 | Cloud2Sketch: Painting with clouds in the sky, AI brush strokes

Evolution of MLOps

阿里云架构师金云龙:基于云XR平台的视觉计算应用部署

五星控股汪建国:以“植物精神”深耕赛道,用“动物精神”推动成长

APP自动化测试框架-UiAutomator2基础入门

APP automation test framework - UiAutomator2 introductory
随机推荐
金山云地震,震源在字节?
“稚晖君”为2022昇腾AI创新大赛打call&nbsp;期待广大开发者加入
The kvm virtual machine cannot be started, NOT available, and the PV is larger than the partition
第十七期八股文巴拉巴拉说(数据库篇)
5个 Istio 访问外部服务流量控制最常用的例子,你知道几个?
Cookie, session, token
js数组对象去重
mysql multi-table left link query
[Cloud Native] 4.2 DevOps Lectures
OKR 锦囊妙计
Technology Sharing | How to Handle Header Cookies in Interface Automation Testing
Space not freed after TRUNCATE table
在“企业通讯录”的盲区,融云的边界与分寸
JS解混淆-AST还原案例
深度剖析 Apache EventMesh 云原生分布式事件驱动架构
【微服务~Nacos】Nacos之配置中心
你的 Link Button 能让用户选择新页面打开吗?
【软考 系统架构设计师】案例分析④ 软件架构风格
Let's talk about what DDL, DML, DQL and DCL are in SQL statements
论文解读(DropEdge)《DropEdge: Towards Deep Graph Convolutional Networks on Node Classification》