zoukankan      html  css  js  c++  java
  • ISO/IEC 9899:2011 条款6.7.7——类型名

    6.7.7 类型名


    语法

    1、type-name:

            specifier-qualifier-list    abstract-declaratoropt

            abstract-declarator:

                pointer

                pointeropt    direct-abstract-declarator

        direct-abstract-declarator:

            (    abstract-declarator    )

            direct-abstract-declaratoropt    [    type-qualifier-listopt    assignment-expressionopt   ]

            direct-abstract-declaratoropt    [    static    type-qualifier-listopt    assignment-expression    ]

            direct-abstract-declaratoropt    [    type-qualifier-list    static    assignment-expression    ]

            direct-abstract-declaratoropt    [    *    ]

            direct-abstract-declaratoropt    (   parameter-type-listopt    )

    语义

    2、在若干个上下文中,有必要指定一个类型。这通过使用一个类型名来实现,这在语法上是对该类型的一个函数或一个对象的声明,此对象或函数省略了标识符。[注:正如语法所指定的那样,一个类型名中的空的圆括号被解释为“不带形参说明的函数”,而不是围在省略的标识符周围的冗余的圆括号。]

    3、例 以下构造:

    (a)    int

    (b)    int *

    (c)    int * [3]

    (d)    int (*) [3]

    (e)    int (*) [*]

    (f)    int * ()

    (g)    int (*) (void)

    (h)    int (* const []) (unsigned int, ...)

    分别命名了:(a)int,(b)指向int的指针,(c)带有三个指向int指针的数组,(d)指向一个带有三个int的数组的指针,(d)指向一个未指定int个数的可变长数组的指针,(f)不带有指定形参的,返回指向int的指针的函数,(g)指向不带有任何形参,返回一个int的函数的指针,(h)一个带有未知个数的,指向函数的常量指针的数组,函数的第一个参数类型是unsigned int,紧接着是未指定参数个数的形参,返回为一个int

  • 相关阅读:
    [转]Maven 初学+http://mvnrepository.com/
    比较IDEA与Eclipse
    [web] 使用Promise封装fetch实现网络超时,终止请求的功能
    [web] 理解和使用Promise.all和Promise.race
    [Web] How to Test React and MobX with Jest
    [Web 测试] Jest单元测试的几个指标
    [Web] 取消Promise
    [安全分析] 安全分析中的威胁情报(一)
    [Web] 深入理解现代浏览器
    [Web] HTML5新特性history pushState/replaceState解决浏览器刷新缓存
  • 原文地址:https://www.cnblogs.com/zenny-chen/p/5012842.html
Copyright © 2011-2022 走看看