我有這個類的構造函數:如何初始化類的數組?
Pairs (int Pos, char *Pre, char *Post, bool Attach = true);
雙班
我如何初始化數組?我嘗試過:
Pairs Holder[3] =
{
{Input.find("as"), "Pre", "Post"},
{Input.find("as"), "Pre", "Post"},
{Input.find("as"), "Pre", "Post"}
};
顯然它不工作,我也嘗試使用()括號而不是{},但編譯器一直在呻吟。很抱歉,如果它是瘸子問題,我GOOGLE了相當努力,但沒能找到答案:/
什麼是你的錯誤? – 2010-06-06 10:19:22
從編譯器發佈錯誤消息時,您通常會得到更快更好的答覆。 – 2010-06-06 10:32:21