计算机二级:如何理解c和c++的复杂类型声明
来源:优易学  2010-1-14 18:57:37   【优易学:中国教育考试门户网】   资料下载   IT书店

 

  float ( * ( *b()) [] )();
  // b is a function that returns a
  // pointer to an array of pointers
  // to functions returning floats.

  void * ( *c) ( char, int (*)());
  // c is a pointer to a function that takes
  // two parameters:
  // a char and a pointer to a
  // function that takes no
  // parameters and returns
  // an int
  // and returns a pointer to void.

  void ** (*d) (int &, char **(*)(char *, char **));
  // d is a pointer to a function that takes
  // two parameters:
  // a reference to an int and a pointer
  // to a function that takes two parameters:
  // a pointer to a char and a pointer
  // to a pointer to a char
  // and returns a pointer to a pointer
  // to a char
  // and returns a pointer to a pointer to void

  float ( * (*e[10]) (int &) ) [5];
  // e is an array of 10 pointers to
  // functions that take a single
  // reference to an int as an argument
  // and return pointers to
  // an array of 5 floats.

  return 0;
  }

上一页  [1] [2] [3] 

责任编辑:cyth

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训