久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

C 在哪里不是 C++ 的子集?

Where is C not a subset of C++?(C 在哪里不是 C++ 的子集?)
本文介紹了C 在哪里不是 C++ 的子集?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在很多書中都讀到 C 是 C++ 的一個(gè)子集.

I read in a lot of books that C is a subset of C++.

有些書說 C 是 C++ 的子集,除了小細(xì)節(jié).

Some books say that C is a subset of C++, except for the little details.

在哪些情況下代碼可以用 C 編譯,但不能用 C++ 編譯?

What are some cases when code will compile in C, but not C++?

推薦答案

如果將 C89C++ 進(jìn)行比較,那么這里有一些事情

If you compare C89 with C++ then here are a couple of things

int n;
int n; // ill-formed: n already defined

int[] 和 int[N] 不兼容(C++ 中沒有兼容的類型)

int a[1];
int (*ap)[] = &a; // ill-formed: a does not have type int[]

無K&R函數(shù)定義樣式

int b(a) int a; { } // ill-formed: grammar error

嵌套結(jié)構(gòu)在 C++ 中具有類作用域

struct A { struct B { int a; } b; int c; };
struct B b; // ill-formed: b has incomplete type (*not* A::B)

無默認(rèn)整數(shù)

auto a; // ill-formed: type-specifier missing

<小時(shí)>

C99 增加了很多其他情況


C99 adds a whole lot of other cases

// ill-formed: invalid syntax
void f(int p[static 100]) { }

沒有變長(zhǎng)數(shù)組

// ill-formed: n is not a constant expression
int n = 1;
int an[n];

沒有靈活的數(shù)組成員

// ill-formed: fam has incomplete type
struct A { int a; int fam[]; }; 

沒有用于幫助別名分析的限制限定符

// ill-formed: two names for one parameter?
void copy(int *restrict src, int *restrict dst);

這篇關(guān)于C 在哪里不是 C++ 的子集?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Algorithm to convert RGB to HSV and HSV to RGB in range 0-255 for both(將 RGB 轉(zhuǎn)換為 HSV 并將 HSV 轉(zhuǎn)換為 RGB 的算法,范圍為 0-255)
How to convert an enum type variable to a string?(如何將枚舉類型變量轉(zhuǎn)換為字符串?)
When to use inline function and when not to use it?(什么時(shí)候使用內(nèi)聯(lián)函數(shù),什么時(shí)候不使用?)
Examples of good gotos in C or C++(C 或 C++ 中好的 goto 示例)
Significance of ios_base::sync_with_stdio(false); cin.tie(NULL);(ios_base::sync_with_stdio(false) 的意義;cin.tie(NULL);)
Is TCHAR still relevant?(TCHAR 仍然相關(guān)嗎?)
主站蜘蛛池模板: 夜夜草导航 | 国产精品精品久久久 | 国产免费看 | 美女久久 | 午夜电影福利 | 日韩在线日韩 | 欧美国产精品 | 男人的天堂一级片 | 老司机成人在线 | 国产精品久久久久aaaa九色 | 欧美黄色一区 | 色婷婷av一区二区三区软件 | 欧美一级黄色片免费观看 | 国产精品自产av一区二区三区 | 国产中文字幕在线观看 | 免费观看黄| 国产精品视频一二三区 | 伊人久久在线观看 | 精品久久久一区二区 | 国产区在线观看 | 国产精品亚洲成在人线 | av免费成人 | 91天堂网 | 欧美www在线观看 | 亚洲成人中文字幕 | 亚洲瑟瑟 | 99久久99| 成人h动漫精品一区二区器材 | 午夜影院网站 | 亚洲精品字幕 | 97免费在线视频 | 国产精品一区二区不卡 | 福利成人 | 成在线人视频免费视频 | 九九亚洲精品 | 日韩欧美在线观看视频网站 | 超碰欧美| 中文成人无字幕乱码精品 | 一级毛片免费看 | 亚洲视频区 | 欧美日韩毛片 |