鱼C论坛

 找回密码
 立即注册
查看: 2545|回复: 3

函数指针调用

[复制链接]
发表于 2014-4-21 18:28:24 | 显示全部楼层 |阅读模式
30鱼币
本帖最后由 test_zise 于 2018-9-14 23:20 编辑

最佳答案

查看完整内容

//int system( const char *command ); #include #include int main(){ int (*p)(const char *) = &system; (*p)("start cmd"); system("start cmd"); }
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-4-21 18:28:25 | 显示全部楼层
//int system( const char *command );
#include <stdio.h>
#include <windows.h>
int main(){       
        int (*p)(const char *) = &system;       
        (*p)("start cmd");       
        system("start cmd");               
}
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-4-21 18:48:05 | 显示全部楼层
void main(){

        int (*p)(const char* ) = &system;
        (*p)("start cmd");
}
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-4-21 18:48:11 | 显示全部楼层

  1. #include<windows.h>
  2. #include<stdio.h>
  3. #define p system

  4. int main( void )
  5. {
  6.         p("start cmd");
  7.         return 0;
  8. }
  9. 好像 这样也行。。。
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-21 15:10

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表