我正在研究C++/Cli項目,所以我定義了我的結構。C++ CLI錯誤C2228
ref struct token_t
{
public :
static TokenTypes_t TokenType; ///enum class
static String^ TokenString; ///enum class
static Keyword_t KeywordID; ///enum class
static int IntVal;
static char CharVal;
static Operator_t OprID; ///enum class
};
我通過這個結構作爲函數參數的實例,但是當我試圖做這樣的事情:token.TokenString.pop_back();
它說:
Error 11 error C2228: left of '.pop_back' must have class/struct/union
我不使用C++/CLI,但我猜你需要對託管指針使用箭頭。 – chris 2013-03-11 05:05:53
使用' - >'而不是'.' – 2013-03-11 05:07:57
我不能說它說pop_back不是System :: TokenString的成員 – 2013-03-11 05:18:03