有什么办法,如何转换这个:
namespace Library
{
public struct Content
{
int a;
int b;
}
}
Run Code Online (Sandbox Code Playgroud)
我在Library2.Content中有结构,其数据定义方式相同({ int a; int b; }),但方法不同.
有没有办法将struct实例从Library.Content转换为Library2.Content?就像是:
Library.Content c1 = new Library.Content(10, 11);
Library2.Content c2 = (Libary2.Content)(c1); //this doesn't work
Run Code Online (Sandbox Code Playgroud)