Test test5 = new Test();
test5.Index = 5;
Test t1 = test5, aaa;
执行完之后test5复制给t1,但是这个aaa变成了Test类型,但是为null。
为什么会有这种语法?
这种语法用在什么地方?
Test test5 = new Test();
test5.Index = 5;
Test t1 = test5, aaa;
执行完之后test5复制给t1,但是这个aaa变成了Test类型,但是为null。
为什么会有这种语法?
这种语法用在什么地方?
C#没有这种写法,你完整的代码是什么。
C++倒是可以,比如
int i;
i = (1,2,3); // i = 3;
或者
int aaa;
i = 1, aaa;
这个叫做逗号运算符。
C#没有