From 539e4af4fd5b9a91918ac5c8196fe6167a2be15a Mon Sep 17 00:00:00 2001 From: yeamour Date: Mon, 18 Jan 2016 14:26:58 +0800 Subject: [PATCH] =?UTF-8?q?s.TestInt.ToString=20()=20=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=B8=80=E4=B8=AA=E7=A9=BA=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这里ts.TestInt.ToString () 会出现一个空引用, 麻烦李总看一下,多谢!! --- UnitTestDll/test_enum.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/UnitTestDll/test_enum.cs b/UnitTestDll/test_enum.cs index 7fe60dc..b090b63 100644 --- a/UnitTestDll/test_enum.cs +++ b/UnitTestDll/test_enum.cs @@ -118,8 +118,18 @@ static void UnitTest_20() MemoryStream str = new MemoryStream (); str.Write (new byte[]{0}, 0, (int)ui); } + + static void UnitTest_21() + { + testStruct ts = new testStruct (); + ts.TestInt = 1; + string str = ts.TestInt.ToString (); + } } - + public struct testStruct + { + public int TestInt; + } }