我正在研究C和C之间的差异.我通过比较您可以对每种语言进行的最基本的程序来做到这一点:
在C:
#include <stdio.h>int main(){ printf("Hello World"); return 0; }
在C.
#include <iostream>int main(){ std::cout << "Hello World!!!" << std::endl; return 0;}
我知道标题和编译过程.但我想知道C和C的#include指令之间是否有任何区别.例如,可能以不同的方式复制复制时的标题内容.
我认为这个问题非常简单,您可以通过说“不”或“是,这是差异:1),2)”来回答.
The implementation shall provIDe unique mapPings for sequences
consisting of one or more nondigits or digits (2.10) followed by a
period (.
) and a single nondigit. The first character shall not be
a digit. The implementation may ignore distinctions of Alphabetical
case.
在C(WG14 N1570 6.10.2 / 5,强调我的):
The implementation shall provIDe unique mapPings for sequences
consisting of one or more nondigits or digits (6.4.2.1) followed by a
period (.
) and a single nondigit. The first character shall not be a
digit. The implementation may ignore distinctions of Alphabetical case
and restrict the mapPing to eight significant characters before the
period.
符合要求的C实现可以将“foobarbaz.h”和“foobarbat.h”映射到同一个源文件.符合C的实现不能.
另外,在C(N1570 6.4.7)中:
If the characters
'
,\
,"
,//
,or/*
occur in the sequence
between the<
and>
delimiters,the behavior is undefined.
Similarly,if the characters'
,or/*
occur in the
sequence between the"
delimiters,the behavior is undefined.
在C中(N4567 [lex.header] / 2):
The appearance of either of the characters
'
or\
or of either of
the character sequences/*
or//
in a q-char-sequence or an
h-char-sequence is conditionally-supported with implementation-defined semantics,as is the appearance of the
character"
in an h-char-sequence.
“有条件地支持实现定义的语义”意味着
>如果实施不支持,则必须发布诊断;
>如果实现确实支持它,则必须记录其对此构造的解释.
而“未定义的行为”意味着实现可以做任何想做的事情.
总结以上是内存溢出为你收集整理的C中的指令#include和C中的指令有什么区别吗?全部内容,希望文章能够帮你解决C中的指令#include和C中的指令有什么区别吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)