VARIANT datatype of C++ into C#
问题 What is equivalent of the VARIANT datatype of C++ in C#? I have code in C++ which uses the VARIANT datatype. How can I convert that code in C#? 回答1: This is a tricky question. From C# 4, you can use dynamic to indicate that the type is known at run-time. By my personal understanding, however, c++ requires the type known at compile time. Thus you might consider to use object , but object in C# is an existent type. For the concept of multi-type, single value (AKA polymorphism) of VARIANT, you