小编xxx*_*xxx的帖子

System :: Boolean和bool在C++/CLI中无法比较?

我正在使用Visual C++ 2008 SP1 Pro.以下代码片段将无法编译:

int main(void) {
    System::Boolean^ foobar = true;
    if (foobar == true) {
        System::Console::Write("yeah!");
    }
}
Run Code Online (Sandbox Code Playgroud)

它给出了以下错误:

1>.\main.cpp(3) : warning C4805: '==' : unsafe mix of type 'System::Boolean ^' and type 'bool' in operation
1>.\main.cpp(3) : error C2446: '==' : no conversion from 'int' to 'System::Boolean ^'
1>        No user-defined-conversion operator available, or
1>        No standard conversion exists from the boxed form of the arithmetic type to the target type
1>.\main.cpp(3) : error C2040: '==' : …
Run Code Online (Sandbox Code Playgroud)

boolean c++-cli

4
推荐指数
1
解决办法
7343
查看次数

如何检查我在MonoDevelop中使用的编译器?

我正在使用Windows.我已经安装了Visual C#2010,mono和MonoDevelop.我知道MonoDevelop可以使用Microsoft的编译器或mono的编译器.如何检查MonoDevelop使用的编译器?我该如何将其更改为其他?

c# mono monodevelop

2
推荐指数
1
解决办法
2891
查看次数

标签 统计

boolean ×1

c# ×1

c++-cli ×1

mono ×1

monodevelop ×1