版本3和4间的区别
于2007-07-19 07:48:55修订的的版本3
大小: 1485
编辑: czk
备注:
于2008-02-23 15:34:54修订的的版本4
大小: 1485
编辑: localhost
备注: converted to 1.6 markup
未发现区别!

A.8.8 Type names

In several contexts (to specify type conversions explicitly with a cast, to declare parameter types in function declarators, and as argument of sizeof) it is necessary to supply the name of a data type. This is accomplished using a type name, which is syntactically a declaration for an object of that type omitting the name of the object.

  • type-name:
    • specifier-qualifier-list abstract-declaratoropt
    abstract-declarator:
    • pointer pointeropt direct-abstract-declarator
    direct-abstract-declarator:
    • ( abstract-declarator ) direct-abstract-declaratoropt [constant-expressionopt] direct-abstract-declaratoropt (parameter-type-listopt)

It is possible to identify uniquely the location in the abstract-declarator where the identifier would appear if the construction were a declarator in a declaration. The named type is then the same as the type of the hypothetical identifier. For example,

  • int int * int *[3] int (*)[] int *() int (*[])(void)

name respectively the types integer, pointer to integer, array of 3 pointers to integers, pointer to an unspecified number of integers, function of unspecified parameters returning pointer to integer, and array, of unspecified size, of pointers to functions with no parameters each returning an integer.

TCPL/A.08.08_Type_names (2008-02-23 15:34:54由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.