About:How to write the declaration of pointers and references rightly.

类别:编程语言 点击:0 评论:0 推荐:

Example1:

how to write a declaration for a reference to an array of 10 integers.

            (&ref)           a reference to
                    [10]       an array of 10
          int                    integers
                         
int v[10], (&ref)[10]=v;

Example2:

Let's try another one:

                  v[10]            an array of 10
                 (*      )           pointers to
                         (int)      function which takes int
          bool                     and returns bool.

bool (*v[10])(int);

本文地址:http://com.8s8s.com/it/it23053.htm