c, c++ 个人笔记

245 阅读1分钟

构造函数:www.cnblogs.com/wkfvawl/p/1… 代码地址:git.dev.tencent.com/Jingya_lu/C…

C语言函数指针讲解

#include <iostream>
using namespace std;

int a;//定义在所有函数外部的变量被称为全局变量,系统不会对其初始化
int func (int x);


int main() {
    // insert code here...
    int(*p)(int x);//定义一个函数指针变量,
    p = func;
    int b = (*p)(4);
    cout << b <<endl;
    
    return 0;
}

//函数定义
int func (int x){
    return x;
}

这是我们oc的block,是不是很像。
- (void)subCoreWebInterfaceWithBaseUrl:(NSString *)baseUrl
    success:(void (^)(NSDictionary *))success
    failure:(void (^)(NSDictionary *))failure
{