看板 C_Sharp 關於我們 聯絡資訊
發現一個現象, 我在VS.NET 2003 / VS 2005裡面, 沒辦法對兩個非Int32作四則運算. 也就是說像 Int16 MyInt1 = 10; Int16 MyInt2 = 20; Int16 MyInt3 = MyInt1 + MyInt2; compile的時候會出現一個error, "Cannot implicitly convert type 'int' to 'short'". 另外當我把一個double的值assign給一個int的時候, VC++會給一個warning說可能會lose data. 但是在C#之中就會是一個error了. 請問一下有什麼solution嗎? Thx...:) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.68.184.96