• C语言指针函数和函数指针


    #include <stdio.h>
    char *test();
    void test1();
    int main()
    {
        /*********************************************
         *  指针函数:返回指针的函数(格式:返回数据类型 * 函数名(参数列表))     
    * 函数指针:指向函数的指针 * * 定义指向函数的指针 * 格式: 函数返回类型 (*指针变量名)(参数列表) * double (*p)(double, char *, int); * 函数的指针赋值(函数名就是函数的地址): * int test(); * int (*p)() = test; * 或者 * int (*p)(); * p = test; * 调用函数: * test(); * (*p)(); * p(); * *********************************************
    */ char *c = test(); printf("指针函数 返回值%s ",c); void (*p)(); p = test1; test1(); p(); (*p)(); return 0; } //指针函数 char *test() { return "rose"; } void test1() { printf("指向函数的指针 "); }
    指针函数 返回值rose
    指向函数的指针
    指向函数的指针
    指向函数的指针
  • 相关阅读:
    关于编码的问题(转)
    XML巩固
    浏览器兼容问题的解决方案
    JavaScript 全局变量命名空间生成函数
    表格的使用(转)
    post上传文件
    安装cocoapods
    UILabel内容模糊
    动态获取键盘高度
    iOS多线程同步锁
  • 原文地址:https://www.cnblogs.com/heml/p/3530270.html
Copyright © 2020-2023  润新知