我正在學習使用ref,但無法理解,爲什麼我得到一個錯誤? class A
{
public void ret(ref int variable)
{
variable = 7;
}
static int Main()
{
int z = 5;
ret(ref z); // Error: Need a refe
我正在一些C#代碼,並有8個點,這正在付諸6個陣列,每一個具有類似於下面的示例不同的組合: Point pt10 = new Point(10,10);
Point pt20 = new Point(20,20);
Point pt30 = new Point(30,30);
Point[] ptArr1 = {pt10, pt20};
Point[] ptArr2 = {pt10, p
我打算使用方法或函數來創建我需要的目錄樹,並將新路徑返回給調用過程。 但我不能讓它編譯 我得到一個錯誤cannot convert method group 'localAttachmentsPath' to non delegate type string .. 這裏是我的代碼 - 我做了什麼錯?還有更好的方法來完成這個嗎? private string localAttachmentsPat