惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
I
Intezer
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
AWS News Blog
AWS News Blog
L
LINUX DO - 热门话题
AI
AI
Webroot Blog
Webroot Blog
W
WeLiveSecurity
O
OpenAI News
T
Threatpost
L
Lohrmann on Cybersecurity
S
Secure Thoughts
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
The Exploit Database - CXSecurity.com
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Security Affairs
V2EX - 技术
V2EX - 技术
Cloudbric
Cloudbric
Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
F
Fortinet All Blogs
G
Google Developers Blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
T
Troy Hunt's Blog
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss
L
LangChain Blog
A
About on SuperTechFans
D
Docker
WordPress大学
WordPress大学
V
V2EX
Simon Willison's Weblog
Simon Willison's Weblog
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs

博客园 - wjwdive

如何使用git submodule拆分大的git项目 MAC多github账号配置步骤 记录一次flutter boost5.0.2示例调试的过程 【算法】可获得的最大点数问题 使用1panel一键建站 关于混合加密(AES+RSA) C++设计模式汇总 设计模式C++005__桥模式 设计模式C++007__抽象工厂方法模式 设计模式C++004__装饰器模式 设计模式C++003__观察者模式 设计模式C++002__策略模式 设计模式C++001__模板方法 使用bundler自动化构建Xcode项目时遇到的问题。 AI图片生成网站 suno AI编曲创作利器 iOS组件化开发之私有库 iOS、Android获取apk公钥MD5信息 阿里图标库批量下载iOS适配的图标 swift 自定义tabbar为基本结构的项目 swift 可选类型
C语言实现回调函数标准方式
wjwdive · 2023-04-18 · via 博客园 - wjwdive
#include <iostream>
#define OFFSET 1000
using namespace::std;

int buttonId;
//定义回调函数的类型  【注意,这里只是用type定义,回调函数一般是作为另一个函数的形式参数的,只注重类型,而调用的时候需要具体实现】
typedef void (* someCallback)(int);

//回调函数的具体实现
void printCallBackId(int cbId) {
    printf("callback id %d \n", cbId);
}

//回调函数的主函数
void setSomeCallback(int offset, someCallback callback) {
    printf("回调执行一次 %d .", offset);
}

void setSomeCallbacks() {
    for (int i = 0; i < 10; ++i) {
        buttonId = i;
        printCallBackId(i);
    }
}

int main(int argc, const char * argv[]) {
    // insert code here...
    cout << "C语言block !!\n";
    setSomeCallbacks();
    return 0;
}