有效的标题名称

时间:2013-03-31 16:24:03

标签: c++ c

我无法正确理解以下文章中的含义:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1566.htm

  

值得注意的是,C89明确只允许使用字母   标题和包含文件名。 C ++添加了下划线,并添加了C99   数字。可能两种标准都应该允许这两种标准。

我在所有C和C ++标准中都发现了以下陈述:

ISO / IEC 9899:1990

6.1.7 Header names

Syntax
1 header-name:
< h-char-sequence >
" q-char-sequence "
h-char-sequence:
h-char
h-char-sequence h-char
h-char:
any member of the source character set except
the new-line character and >
q-char-sequence:
q-char
q-char-sequence q-char
q-char:
any member of the source character set except
the new-line character and "

ISO / IEC 9899:1990

5.2.1 Character sets

...

Both the basic source and basic execution character sets shall have the following
members: the 26 uppercase letters of the Latin alphabet

A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z

the 26 lowercase letters of the Latin alphabet

a b c d e f g h i j k l m
n o p q r s t u v w x y z

the 10 decimal digits

0 1 2 3 4 5 6 7 8 9

the following 29 graphic characters

! " # % & ' ( ) * + , — . / :
; < = > ? [ \ ] ^ _ { | } ~

例如,即使在C89 / C90中,我也会看到下划线和数字。

1 个答案:

答案 0 :(得分:2)

它指的是:

  

分隔符之间应该有一个实现定义的映射   序列和外部源文件名。实施应   为由一个或多个序列组成的序列提供唯一映射   字母(在$ 2.2.1中定义)后跟一个句点(。)和一个单词   信件。实现可能会忽略的区别   按字母顺序排列并将映射限制为六个重要的   期间之前的人物。

(C89)

这是C99版本:

  

实现应为序列提供唯一的映射   由一个或多个字母或数字组成(如5.2.1中所定义)   然后是句号(。)和一个字母。第一个角色应该   是一封信。实现可能会忽略的区别   字母大小写并将映射限制为八个重要的   期间之前的人物。

相关问题