c语言函数用指针传递参数问题

发布时间:2011-08-29 共3页

  问题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];

百分百考试网 考试宝典

立即免费试用