相关疑难解决方法(0)

为什么枚举需要显式转换为int类型?

这样做没有数据丢失,那么为什么必须明确地将枚举转换为整数?

如果它是隐含的,那么它是不是更直观,比如当你有更高级别的方法时:

PerformOperation ( OperationType.Silent type )
Run Code Online (Sandbox Code Playgroud)

在哪里PerformOperation调用一个被暴露的包装C++方法:

_unmanaged_perform_operation ( int operation_type )
Run Code Online (Sandbox Code Playgroud)

.net c# enums casting

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

标签 统计

.net ×1

c# ×1

casting ×1

enums ×1