摘要: # 指针函数 指针函数有些像C#中的委托delegate(不知道理解的对不对)。 ## 定义函数指针 ```cpp int *compare(int, int ); ``` 一般简写为 ```cpp typedef int (*compare)(int,int); ``` 这样就定义了一个名为com 阅读全文
posted @ 2023-06-26 22:46 胖子说嘛 阅读(35) 评论(0) 推荐(0)
摘要: # 指针形参与引用参数 ### 指针形参 指针作形参时,若在函数中修改指针对象的值,则对应实参的值会对应修改。 ``` C++ #include using namespace std; void Change( int *p){ *p=400; }; int main(int argc, char 阅读全文
posted @ 2023-06-26 21:16 胖子说嘛 阅读(67) 评论(0) 推荐(0)