Questions tagged «out-parameters»



2
在C#中将属性作为“输出”参数传递
假设我有: public class Bob { public int Value { get; set; } } 我想将Value成员作为out参数传递 Int32.TryParse("123", out bob.Value); 但出现编译错误,“'out'参数未归类为变量”。 有什么方法可以实现这一目标,或者我将不得不提取一个变量,例如: int value; Int32.TryParse("123", out value); bob.Value = value;
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.