设为首页 加入收藏

TOP

c语言函数用指针传递参数问题
2014-11-23 20:06:41 】 浏览:5670
Tags:语言 函数 指针 传递 参数 问题

  问题1:你是把变量传给了函数,还是把地址传给了函数?


  例:


  #include


  #include


  #include


  void


  oxx(char* dest)


  {


  dest = (char*)malloc(30);


  strcpy(dest, "content has been modied");


  }


  void


  oxx2(char* dest)


  {


  strcpy(dest, "content hat been modied");


  }


  int


  main()


  {


  char* dest;


  char str[30];


  dest = &str[0];


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇关于C语言中的无符号数和有符号数 下一篇C语言一个微妙的Bug

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目