value-initialization

    10熱度

    1回答

    可能重複: What do the following phrases mean in C++: zero-, default- and value-initialization? 如果我有例如一個類: class Info { int x; int y; }; 這在我以前創建的對象, Info *p = new Info(); Info旁邊的括號是否表示我正在初始

    7熱度

    3回答

    我的問題是有關Prasoon的question關於非POD類型和值初始化。 我試着像Ideone和鍵盤在線編譯器下面的代碼,但可執行文件的兩個站點了運行時錯誤。 #include <iostream> #include <cassert> struct Struct { std::string String; int Int; bool k; }; str