c 0x和c 11是什麼關係?0x又是什麼意思?

時間 2021-05-07 06:50:34

1樓:

The old -std=c++0x is only needed for older compiler versions that did not support -std=c++11 and they chose that name to express the preliminary and unstable nature of features (and the ABI) of the then upcoming C++11 (and when it was still unclear whether that would eventually become C++10 or C++12). They changes some of the details adapting to the changing working drafts of the standard at the time before the C++11 standard was officially released.

If your compiler supports -std=c++11, there is no reason to use -std=c++0x. Concerning compatibility: There might even be differences and incompatibilities, but these are not just bound to the use of -std=c++0x, but to specific versions of the compiler.

When the compiler supports both, they should be identical.

豆瓣: -std=c++11 -std=c++0x

2樓:劉項

同意@程劭非 的答案,

我補充一下。

上乙個版本的C++國際標準是2023年發布的,所以叫C++ 03。

然後C++國際標準委員會在研究C++ 03的下乙個版本的時候,一開始計畫是07年發布,所以最初這個標準叫C++ 07。

但是到06年的時候,官方覺得07年肯定完不成C++ 07,而且官方覺得08年可能也完不成。最後乾脆叫C++ 0x。x的意思是不知道到底能在07還是08還是09年完成。

結果2023年的時候也沒完成,最後在2023年終於完成了C++標準。所以最終定名為C++11。

C 11 中 typedef 和 using 有什麼區別?

碧水溪風 說個真事,同事n年c 開發經驗,c 特別溜。有一次我拿typedef和 define反過來覆過去問他,一分鐘不到他就懵圈了,根本分不清typedef和 define該怎麼用了。 原子筆 using 是C 11用來擴充套件typedef 的,不在typedef上擴充套件是為了盡可能保持C語言...

為什麼heap spary要用0x0C0C0C0C這個奇怪的數字?

原因很簡單,因為在DEP出現之前堆噴是一種不精準的技術。就是說它需要一段滑板指令來增大靶子的面積。在這種情況下就需要乙個值,當它是位址時是我們的堆噴可以抵達的,當它是指令時是可以當成滑板指令不影響執行的。所以0x0C0C0C0C就成為了通用位址。那麼為什麼nop這種在棧中常用的滑板指令不行?你可以想...

C 11為什麼引入nullptr?

徐辰 因為C 他爹早就看0這個magic number不爽了,當年沒顧上搞,一直拖到2011年了,再不瘋狂一把C 就沒人用了。 enpeng xu 問題的關鍵是c 不知道怎麼正確做void 到 T 的預設轉換,所以多此一舉的引入了nullptr。某些情況做下c 編譯器不知道怎麼把 void ptr正...