摘要:
define和const区别 首先c语言的const定义一个变量不可以修改,必须要初始化 const int a = 10; int const a = 10;//两者等价 变量是不能作为数组的长度的,c语言中的const定义的变量是不能这样使用,但是c++const定义的变量可以作为数组的大小进行 阅读全文
摘要:
extern总结 1、extern声明外部变量已经被定义,可以应用 //file1.c: int x=1; int f(){do something here} //file2.c: extern int x; int f(); void g(){x=f();} 注意extern int x没有开辟 阅读全文
摘要:
回调函数 回调函数可以把函数指针作为参数传到另一个函数,就是在特定的事件发生后我们要调用这个实现,作用可能就是解耦。 #include<stdio.h> int Callback_1(int x) // Callback Function 1 { printf("Hello, this is Cal 阅读全文