C# Tutorial | wiki
Lesson 1
Main(): like main() in C, 一個專案只能有一個 Class 有 Main()
give 命令列參數in IDE, app/屬性/偵錯/起始選項/命令列的引數
還可以簽署[todo]
args[0]:取得命令列參數
C:\> a.exe 123
args[0]==123
{0}: Parameter Position Holder
Lesson 5
ref: like C & (pass by reference)
out: like VB (output variable for return more than one value)
params: 不定個數參數
f(params string[] names)
f("apple","banana","orange")
f( string[] names)
f(["apple","banana","orange"])
static void Main(string[] args)
{
string[] names = { "a", "b", "c" };
this.DemoParams("a", "b", "c");
this.WithoutParams(names);
}
this 不能用在靜態成員
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment